Forum

Order Open Price when buy or selling on a breakout

Hi, I 'am creating an EA that should buy or sell on a breakout of a fractal bar. Which level should I use? Do I have to use the high of the fractal bar + the spread of the currency pair ? If I reverse when there is a signal in the other direction it is closing the open orders first, but the order in

Closing orders and opening one in other direction

Hi, I'm coding an EA using pending orders. At a given time, I could have 2 or 3 buy orders opened and a pending sell order . The level where the pending sell order should be opened is used as a stoploss for all the opened buy orders. The problem is that it tries to open the sell order before the buy

EA mixes BUY and SELL orders

Hi, I'm trying to code an EA and at some place in my code I've to update the stoploss of opened and pending orders . I'm displaying an alert with the informations about the order. When I run it, I receive a message like: "Count: 2 Stoploss 1.44705 for buy order: 46450421 orderType: 1". orderType: 1