my ea does not take sell positions.
-
Hi
I have created an ea based on a low pass filter indicator and previous 52 candle high/low. The ea takes Buy positions but not even single Sell. Can anybody tell me what the problem is?this the link : https://fxdreema.com/shared/S96Vy9SV
Thanks
-
@saadatfx - I am not familiar with that custom indicator but in Blocks 15 & 16 you have the same Output Buffer....
That may be the problem.....(?)
-
@Morpheus_0 Thanks but I don't think that's the problem, cause when I remove block 17 and 18 it takes sell positions even with the same buffer.
-
@saadatfx - Strange. So the problem is likely in block 18 but I couldn't tell you what it is....Sorry...:(
But keep at it. There's usually a solution*
-
@saadatfx The problem is with that variable called 'low_52_price'. Can it be 0? If so no number can be below 0 as required by block 18.
-
@l-andorrà I used custom mql block to generate two variables.
This is the first one:
low_52_candle=iLowest(NULL,0,MODE_CLOSE,52,1);
low_52_price=Low[low_52_candle];and this is the second on:
high_52_candle=iHighest(NULL,0,MODE_CLOSE,52,1);
high_52_price=High[high_52_candle];Buy position works fine with "high_52_price" in block 17. But sell position doesn't work.
-
But that custom code is not connected to any block so it is not executed.

-
I put comments to check if the values of so called variables are being calculated correctly or not which they were. But still no lock on Sell positions. So I found and used another custom indicator to give high and low based on a period and it worked.
-
Congrats!
-
@saadatfx
iHighest(NULL,0,MODE_CLOSE,52,1)Do you mean i+1 rather than 1.
iHighest(NULL,0,MODE_CLOSE,52,i+1)"i" mean the current bar of interest. Maybe not "i" exactly. You can simply set a variable to get the current bar and then use it instead.