Questions on Fractals

 

Hi All,

I am new in programming. I have an EA which run which correctly, decided to change the strategy  by using the fractals indicator. The resulting EA opens only long positions for both buy and sell conditions. The "if" statement: if C1<iFractals (Null,0,MODE_LOWER,0); Sell and if C1>iFractals (Null,0,MODE_UPPER,0); Buy. Really I need it to Open Long and short position when the predetermined conditions are fulfilled. Can anyone help? Thanks.

 
iFractals (Null,0,MODE_LOWER,0);
A fractal will never be printed on the current bar, so I believe that it will always return 0.0
 

I have deleted your other topic which was basically the same

 Hi All,

In spite of everything I have done, my EA still trades in one direction: only long trades are executed, even when the condition is for a sell trade. It opens a long position when condition for long trade are met and also opens a long trade when conditions for short trade are met. Can anyone offer any explanations as to could be the matter? I appreciate your help. Thanks. The if Statement: if  C1>iFractals(Null,0,MODE_UPPER,0); Buy: and if C1<iFractals(Null,0,MODE_LOWER,0); Sell.

You have already been told that the current bar does not have a fractal value, so why re-post the same question?
Reason: