magft wrote:
Can you have a look at the Breakeven code as there is still an error. I have a loop now that the is changing the SL from the early one to the updated one i think. Some thing in the logic is wrong but
i cant look at it now, got to do the day job!
Also, i think in LookForTradingOpportunities where we set the price based on high/low of previous candle, i'm wondering if tex's problem is to do with how we add the sl/tp to the calculated price for POs.
I really must get on, but this is more fun than thermodynamic calculations
Mike
In LookForTradingOpportunities, I see two issues. First of all, when you successfully set a pending order, the TP and SL are based on the price you wanted, not what you get when you finally get filled. I struggle with my own trading whether I should update the SL/TP when I have particularly bad slippage, so I don't have any advice for you here. This problem would be apparent if the distance between the TP and SL are still TP+SL pips away and the entry price has slid up or down between them.
The second issue is the same issue, but more apparent in the code. If you find that you have to change to a OP_BUY or OP_SELL, you should probably reset price to Ask (or Bid) and then calculate TP and SL from the new price. I know that seems to go against my last paragraph, but I'm a complex guy. Actually, since the code doesn't check to see how far price has gone above Ask, you could be entering really late in the move and have crummy risk/reward without knowing it.
One other question I have is whether you are supposed to consider the price target (the High of the trigger candle +BuyBufferPips) as the price that the bid has to be at in order to enter the trade or whether the BuyBufferPips includes the spread. If the former, than to be consistent with the methodology you would need to add the spread to your price before calculating everything.
I didn't see anything in BreakEvenStopLoss, but I'll have another look.
George