Dominik Egert:
You are right , i thought i could get the candle id having the lowest value in for loop , but it seems like iLowest and iHighest only works from current candle backwards , is there any way to get the lowest and highest value from past candles? iLowest(..., 5+i,...)
Check the docs and see if that is what you want. - I don't think this is what you explained.
like for example candle 50 candle 51 candle 52 candle 53 candle 54 are the candles that i am interested in and if i want to get the candle ID of the candle that has lowest low out of the 5 mentioned candles ?
can this be acieved using iLowest ? or am i just wasting time trying to get it with this function ?
Shanty94:
You are right , i thought i could get the candle id having the lowest value in for loop , but it seems like iLowest and iHighest only works from current candle backwards , is there any way to get the lowest and highest value from past candles?
like for example candle 50 candle 51 candle 52 candle 53 candle 54 are the candles that i am interested in and if i want to get the candle ID of the candle that has lowest low out of the 5 mentioned candles ?
can this be acieved using iLowest ? or am i just wasting time trying to get it with this function ?
You are right , i thought i could get the candle id having the lowest value in for loop , but it seems like iLowest and iHighest only works from current candle backwards , is there any way to get the lowest and highest value from past candles?
like for example candle 50 candle 51 candle 52 candle 53 candle 54 are the candles that i am interested in and if i want to get the candle ID of the candle that has lowest low out of the 5 mentioned candles ?
can this be acieved using iLowest ? or am i just wasting time trying to get it with this function ?
baar =iLowest(NULL,0,MODE_LOW,5,50);
As Dominik said, you should read the documentation
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to get the lowest candle ID inside for loop
Use case:
Step 1: i am using for loop to check candle ID of the candle on which the indicator is visible most recently, and then break the loop
Step 2: i am using iLowest() to get the candle ID of the bar having the lowest value out of 5 ,
Step3 : using the candle id (from step 2) to get low value of that candle and then calculate the SL for that candle.
But i am getting wrong ID of candle in Step 2.
please have a look at the attached screenshot, the comment of bar should be 74 but it shows 135
What am i doing wrong ?
Here is my code :