TriggerCandle
with 50
.if(prev_calculated!=rates_total)
rates_total-1
to rates_total-2
here:if(VendaBuffer[rates_total-1]!=EMPTY_VALUE)
if(CompraBuffer[rates_total-1]!=EMPTY_VALUE)
EMPTY_VALUE
. A bit later, when the indicator value gets updated, the initial prev_calculated!=rates_total
fails because it is no longer a new bar, hence no alerts get issued.rates_total-1
to rates_total-2
) it will be checking only fully completed bars (so, the one just before the current bar) for alerts.thank you, it workedI think you should either get rid of this condition (and apply some time variable check to avoid multiple alerts from the same bar):
Or you should changeMQL5:if(prev_calculated!=rates_total)rates_total-1
torates_total-2
here:
and here:MQL5:if(VendaBuffer[rates_total-1]!=EMPTY_VALUE)
Because currently it works like this: a new bar arrives and the alert code is checked on it, but the bar is just 1 tick old - it has Open = High = Low = Close, so the indicator value likely remains equalMQL5:if(CompraBuffer[rates_total-1]!=EMPTY_VALUE)EMPTY_VALUE
. A bit later, when the indicator value gets updated, the initialprev_calculated!=rates_total
fails because it is no longer a new bar, hence no alerts get issued.
If you apply the second change (rates_total-1
torates_total-2
) it will be checking only fully completed bars (so, the one just before the current bar) for alerts.
I am in search of anyone that can code a verticle rectangle box indicator that can cover/block off candlesticks on the hard right edge of mt4 platform? any interac
Good day, thank you for the reply. With regards to the box, my intention is for the rectangular box to cover the whole right hight hand edge of mt4 platform, with a width of 40candles. the heght of the box would then be edge to edge from top to bottom regardles of the timeframe. If i was to change timeframes the box would still be on my right hand edge covering a width of 40candles top to bottom. The goal of the rectangular box is for when I'm looking at previous years price action, it covers 40candle width at right hand, so that I am then able to project future price movement candle by candle using F12. Currently my OCD makes it hard for me just to use my mt4 platform as is. The box gives my mind that future price still has to come. I acknowledge I wasnt clear in my discription on the first post.it would help to know just how many candles you are talking about covering..... the script below goes in the scripts folder......
//-------
it uses the highest high and lowest low during the period back set by bar......
it will change the chart fore/back ground setting.....
it first deletes prior rectangle of same name.....
color is selectable......
it is draggable....
it is simple......h
//------
yes, but probably not in the manner you are wanting.....Can the box settings be changed i.e height width?
When accessingHi I followed the tutorial to add alerts but alert is not triggering alerts. I am not sure of what i did wrong.
bufferUp
and bufferDown
values, you don't need to use [rates_total - 1 - TriggerCandle]
selector, use [TriggerCandle]
instead. That's because they are set as series in the indicator's initialization function.Thank very much, if i change the trigger candle to 1 it does not give an alert.When accessingbufferUp
andbufferDown
values, you don't need to use[rates_total - 1 - TriggerCandle]
selector, use[TriggerCandle]
instead. That's because they are set as series in the indicator's initialization function.
The indicators buffers are shifted 2 bars to the left, so the latest meaningful value there can only be at index 2. Try setting TriggerCandle to 2.Thank very much, if i change the trigger candle to 1 it does not give an alert.
Yes when it is set to 2 it does give alert, how can i set it so it can give alert from when the trigger is set to 1The indicators buffers are shifted 2 bars to the left, so the latest meaningful value there can only be at index 2. Try setting TriggerCandle to 2.
You can move the indicator values 1 bar to the right. Just changeYes when it is set to 2 it does give alert, how can i set it so it can give alert from when the trigger is set to 1
[i+2]
to [i+1]
on lines 90 and 95 .Ok, thanksYou can move the indicator values 1 bar to the right. Just change[i+2]
to[i+1]
on lines 90 and 95 .