Spécifications
In my EA I want to fix an error and add global vriables so EA nows if orders are open when restarting.
Description of EA: I have already an EA which is opening after first installation (under Strategie 1) a buy and sell order and after one of these orders has been closed, ea is placing a pending order with an entry trigger. Note EA does only place at the beginning an buy and sell order. If buy is closed EA open an buy in Pending with an trigger. If sell is closed EA open an sell in trigger. This goes so on.
If this pending order with trigger is executed in the market, EA is opening again and pending after the order in market is closed and so on.
This is Strategy of EA - Do not change anything of Strategie of Strategie 1.
Error is - That EA does open after several Time to the beginning open buy and sell again an buy and sell. This should be fixed. EA should only open an buy and sell and if one of this is closed the pending for the order and so on.
Second change. EA should know his orders under global variables to ovoid also double opening.
1. After restarting Terminal or new installation EA forgot all ticket and try work with new. EA should check to have only 2 open orders in pending and 2 Orders open in Market – each from them can only be a buy and an sell.
So in Market kann never 3 orders from EA - always only two - the buy and sell.
EA should remember his oders and tickets. So after restarting plattform, problem with Internet EA should knows status of before.
If EA does not have 2 Orders in Market and not 2 Orders in Pending – EA should open 2 Orders Market.
If EA does not have 2 Orders in Market but 2 Orders in Pending – EA should do nothing.
EA does never have 3 or 4 Orders in Market…. Never only 2 and this can only be a buy and a sell order.
Can be a text file which save all ticket numbers there and update it repeatedly. so when restart the system or any other disconnection of system can check it's text first to remember them.