Write your code and your try and maybe someone can be gentle to fix it for you.
Write your code and your try and maybe someone can be gentle to fix it for you.
I have done that please
You wrote rules to create arrows when close[i] is above MA_TP and low[i] is below MA_HIGH.
It's totally different from the question you asked for (displays an arrow if the close of candle [i] is > the close of a ‘specified’ number of previous candles)
You wrote rules to create arrows when close[i] is above MA_TP and low[i] is below MA_HIGH.
It's totally different from the question you asked for (displays an arrow if the close of candle [i] is > the close of a ‘specified’ number of previous candles)
Yes I want to add this new rule(displays an arrow if the close of candle [i] is > the close of a ‘specified’ number of previous candles) to the already existing one(close[i] is above MA_TP and low[i] is below MA_HIGH). I tried using values from the High[] and Close [] array but didn't work so I deleted those lines of codes
iHighest and iLowest can help you, read documentation.
-
double HighestCandle; HighestCandle=ArrayMaximum(High,0,11);
Perhaps you should read the manual. The function does not return a double. -
if (close[i]<open[i]&&close[i]<MA_LOW[i]&&high[i]>MA_LOW[i]&&close[i]>=LowerCloseCandle)
You are looping through all candles, but LowerCloseCandle is only about the latest 11, instead of the eleven related to i.
How to do your lookbacks correctly.
- Perhaps you should read the manual. The function does not return a double.
- You are looping through all candles, but LowerCloseCandle is only about the latest 11, instead of the eleven related to i.
How to do your lookbacks correctly.
Thanks for your input sir, I have read the attached thread but still didn't get it. All I want is to get the close of 'i' which is the lowest or highest among a specified number of previous consecutive candles. Any help with regards to the coding will be much appreciated. Thank you
Also you are copying the whole indicator buffers for every new tick. This is unnecessary and time consuming. Copy only limit values instead of using Bars(), and the ArraySetAsSeries on MA_HIGH/MA_LOW/MA_TP can be called once in OnInit. Then why don't you work with high directly instead of CopyHigh() to High?
Help me with the code please.
Help me with the code please.
for (int i = limit; i >= 0; i--) { int index=ArrayMaximum(high,i,11); double highest=high[index]; // highest high of the 11 bars at i

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I’m trying to code an indicator that displays an arrow if the close of candle [i] is > the close of a ‘specified’ number of previous candles (ie if it closes above the previous number of specified candles) but I can’t find my way out of this. Kindly help community.