The program works on the H1 period, does not set StopLoss and TakeProfit, opens orders and closes them itself.
Program operation principle:
- The program opens a sell or buy order regardless of the previous candle.
- It opens trades during 59 minutes and opens/closes trades during an hour.
- The program contains scalping elements.
Specify the lot size in the Lots parameter.
- The on parameter defines the program activation time in hours. For example, if you want the program to start at 10:00, set on=10.
- The off parameter defines the program deactivation time in hours. For example, if you want the program to stop opening orders and to be removed (deactivated) at 10:00, set off=10.
- The Magic parameter is the magic number of the orders. Can be used as an identifier determined by user.
Test on a demo account
The algorithm of the program:
It opens an order with the minimal lo (not bound to the 'lots' parameter) every hour.
If the profit of the opened order is greater than 0, the order is closed and an order is opened at the 59-th minute.
If the profit of the opened orders is less than 0, the order is closed and loss is fixed and the 59-th minute.
Next, the program calculates how many orders should be opened to cover the loss. The calculation considers the 'risk' parameter, orders are bound to the 'lots' parameter.
risk - when the EA opens a few orders in a minute, they are closed after their pofit excceeds the specified value.