have u created an 8 hour chart ?
& 4 the next time please use SRC 4 code
Could someone look over this piece of code and see if they notice what the problem is? I keep getting error 4107 and 130.
What I am trying to do is to have it set a pending order using the high and low from the past 8 hours. Thanks for the help.
<REMOVED>
Please use the SRC button to post code . . .
As Gjol says, there is no such thing as an 8 hour TF
Max_Price=NormalizeDouble(iHigh(Symbol(),480,1),Digits);
Will return 0
Thanks for the responses. Sorry about not using the SRC button.
I don't have the option for PERIOD_H8. I changed it to 4 hours.
Is there are a way to change this to easily change this one line to use the high of the last two periods. Or do I need to write it as an if statement that will compare the high of the last two 4 hour periods and take the highest of the two.
Max_Price=NormalizeDouble(iHigh(Symbol(),PERIOD_H4,1),Digits);
Max_Price=NormalizeDouble(iHigh(Symbol(),PERIOD_H4,iHighest(Symbol(),PERIOD_H4,MODE_HIGH,2,1)),Digits);
past eight hours
use PERIOD_H1 in calculation like GumRai showed
What I am trying to do is to have it set a pending order using the high and low from the past 8 hours. Thanks for the help.
I don't have the option for PERIOD_H8. I changed it to 4 hours.
Is there are a way to change this to easily change this one line to use the high of the last two periods. Or do I need to write it as an if statement that will compare the high of the last two 4 hour periods and take the highest of the two.
past eight hours
use PERIOD_H1 in calculation like GumRai showed
Hmm, yes, not clear exactly what Saricha wants
Of course, for the last complete 8 x 1 hour bars, it would be
Max_Price=NormalizeDouble(iHigh(Symbol(),PERIOD_H1,iHighest(Symbol(),PERIOD_H1,MODE_HIGH,8,1)),Digits);
Last 8 hours is not the same as last two H4 bars. | iHigh(Symbol(),PERIOD_H1,iHighest(Symbol(),PERIOD_H1,MODE_HIGH,8,1) iHigh(Symbol(),PERIOD_M1,iHighest(Symbol(),PERIOD_M1,MODE_HIGH,480,1); // Or |
Last 2 H4 bars | iHigh(Symbol(),PERIOD_H4,iHighest(Symbol(),PERIOD_H4,MODE_HIGH,2,1) MathMax( iHigh(Symbol(),PERIOD_H4, 1), iHigh(Symbol(),PERIOD_H4, 2) ); // or |
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. | It's use is always wrong |
Could someone look over this piece of code and see if they notice what the problem is? I keep getting error 4107 and 130.
What I am trying to do is to have it set a pending order using the high and low from the past 8 hours. Thanks for the help.
Thanks