Quote:
If you want to use TAs to close trades, or CL, CS icons as a simulated TA and you want to use the current bar you should trade all ticks
so I use completed bars set to false, and I can use High[0] for buy to use CL, and Low[0] for sell to use CS to close short.
Only issue I have now is trading diagram use MQL with the condition with to the CL or CS block. However in expert log, if no trade is opened by specific MQL conditions for the BUY or SELL, and the conditions is met for TP occurs, it still sends the CLOSELONG() or CLOSESHORT() when it's not needed.
So cleaner way is to really check are there any trades running then run such TP conditions, to execute CL or CS. I can't see how to check for any open positions from SB trading diagrams with the blocks given, other than going in code and perhaps doing something along those lines where the MQL code block for such CS or CL occurs
Quote:
if (CalculateOpenPositions(Symbol(),OP_SELL,MagicNumberShort)>=0) {
if ( MQL CODE BLOCK AT TP ) { CLOSESHORT(Symbol()) ;}
}
if (CalculateOpenPositions(Symbol(),OP_BUY,MagicNumberLong)>=0) {
if ( MQL CODE BLOCK AT TP ) { CLOSELONG(Symbol()) ;}
}