How can I write the following EA with code blocks?
-
How can I write the following EA with code blocks?
METATRADER 5 - MQL 5
BUY: High > Highest( Close , 48)
SELL: Low < Lowest ( Close,48)
System will buy when the 48-bar high is broken, and close the position with Stoploss, Takeprofit, and trailing. System will sell when the 48-bar low is broken, and close the position with Stoploss, Takeprofit, and trailing. System will only trade in the long direction, or only in the short direction.Stoploss: 1%, Profit: 10% (not in pips, but in percentage)
Trailing Stop: Initial trailing stop is 2%, trailing stop will continue at 1% once the profit reaches 6%
Input values can be assigned and changed:
-High-Low bar count: (which is 48),
-Stoploss,
-Profit,
-Lot,
-Long-Short direction (for single-double direction use),
-Initial trailing stop( which is 3% ),
-Trailing profit condition: (which is 6%) ,
-Trailing stop value after profit: (which is 1%) -
Have you tried to create your first draft? That would help.
