Highest Bar MQl4
There is Highest Bar and lowest bar in MQL4 but how would you program highest ATR value.
If you had used this, you would have found this: how can i find a bar which have lowest or highest indicator index? - Indices - MQL4 and MetaTrader 4 - MQL4 programming forum
How can I search for indicators and other elements in this forum? - MQL5 programming forum #1 (2017) #10 (2021)
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
If you had used this, you would have found this: how can i find a bar which have lowest or highest indicator index? - Indices - MQL4 and MetaTrader 4 - MQL4 programming forum
How can I search for indicators and other elements in this forum? - MQL5 programming forum #1 (2017) #10 (2021)
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
thanks William and Adj007, i worked it out, it was a whole array issue, similar to what you sent through.
Create a buffer for an array. Use the buffer on the ATR with for loop, loop should have a reset count. Return the highest value using ArrayMaximum.
Hi Adj,
is this what you mean?
int BarIndexHigh() { int BarsToCheck=400; double IndicatorValues[400]; for(int i=0;i<BarsToCheck;i++){ IndicatorValues[i]=iATR(NULL,0,7,i); Print(StringConcatenate("BarIndex_",i," ATR: ",IndicatorValues[i])); } int BarIndexHigh=ArrayMaximum(IndicatorValues); return BarIndexHigh; }
Create a buffer for an array. Use the buffer on the ATR with for loop, loop should have a reset count. Return the highest value using ArrayMaximum.
Hi Adj007,
A question similarly along those lines; During a day session of trading if I had a Price doing that of the image below, how would I calculate B to C after calculating A to B.

Hi Adj007,
A question similarly along those lines; During a day session of trading if I had a Price doing that of the image below, how would I calculate B to C after calculating A to B.
The distance from b to c would need to be shorter than calculated a to b for ab and bc to be comfirmed further.
I believe william attatched a code on here which seemed to be ok, but I think your code isnt right again as you dont return a function into a function
The distance from b to c would need to be shorter than calculated a to b for ab and bc to be comfirmed further.
I believe william attatched a code on here which seemed to be ok, but I think your code isnt right again as you dont return a function into a function
Thanks Adj007, William's programming worked thankfully. With the B to C component; would I then take the highest and lowest price within that distance? So, for instance;
HC= Highest Candle LC= Lowest Candle Dist1= ??? Dist2= ??? double BtoC = (HC+(HC-LC)) if(dist2 < dist1 && BtoC*(ATR Value)) { OrderSend()... }
There is Highest Bar and lowest bar in MQL4 but how would you program highest ATR value.