Hi
I would like to be able to close a position based on the closing size of a candle. So, if the candle closes X pips/points higher or lower than it opened then close the trade.
Can anyone help with code for this condition please?
Thanks
Robert
Seems like an ordinary “takeprofit” to me?
set target pprofit 15 //close an order in profit of 15 points
Well, I only want it to occur should it happen during a trade. I don’t want to set a system wide takeprofit. Does that make sense?
Takeprofit are individual for each order with ProOrder IG.
Hi Nicolas
So does this scenario make sense.
I’m coding a system which has the default DEFPARAM CumulateOrders = False set. Therefore, my understanding is that I can only have one buy or sell order in the market at a time, correct?
One position might hit a candle which goes up or down 30 points. Some may not hit such candles but over the position move 150 points.
If I set a take profit of say 25 then both trades would be closed at 25 points, would they not?
Thanks
Robert
if close>=open+25*pipsize then
sell at market
endif
Thank you Elborg, I was looking for encoding the size of a candle For 3 days, thanks a lot !