How to apply comment to SL/TP hits

 

Dear all

I have multi-symbol and multi-strategy EA which is running well.

I need assistance as how to place a comment in SL/TP hits to know which symbol/strategy it belongs.

I have been able to put comments on Entry / OrganicExits, but failing to do same on SL/TP.

Any guidance will be highly appreciated.

Regards

 
  1. The trade give you which symbol.
  2. The magic number gives you which strategy.
  3. Comments can not be changed
 
I would like to know why my trade ran into loss and closed yet I set break even and put my stop loss above my buying point, when the market reversed my trade closed beyond my stop loss and closed in loss. Please do assist, thank you
 
Reignman012 #:
I would like to know why my trade ran into loss and closed yet I set break even and put my stop loss above my buying point, when the market reversed my trade closed beyond my stop loss and closed in loss. Please do assist, thank you
Because slippage exists, you need to learn what it is.
 
William Roeder #:
  1. The trade give you which symbol.
  2. The magic number gives you which strategy.
  3. Comments can not be changed
thanks William
 
Anil Varma:

Dear all

I have multi-symbol and multi-strategy EA which is running well.

I need assistance as how to place a comment in SL/TP hits to know which symbol/strategy it belongs.

I have been able to put comments on Entry / OrganicExits, but failing to do same on SL/TP.

Any guidance will be highly appreciated.

Regards

I worked with multiple Expert Advisors and faced a similar issue before.

for that purpose i used the Magic Number to distinguish between different EAs and strategies,by assigning a unique Magic Number to each EA
 
Ayman Ramadan Soroor #:
I worked with multiple Expert Advisors and faced a similar issue before.

for that purpose i used the Magic Number to distinguish between different EAs and strategies,by assigning a unique Magic Number to each EA

HI Ayman

Thanks for the reply and suggestion.

Well I do use Magic No, but instead of EA, I set it for each strategy. Off recently I have noticed trade from one strategy is closed/exited by another strategy logic. Need to further explore the potential cause.

void CS5003SuperTrend::posTrailEXIT(void) {

        string vMethod  = "[" + mSymbol + "] " + __FUNCTION__;
          int    posCount = PositionsTotal();
        //+---------------------------------------------------------------------------------------------------------------------------+
        //| Itirate all open position(s)
        //+---------------------------------------------------------------------------------------------------------------------------+
          for(int i = (posCount-1); i >= 0; i--) {
        ulong ticket = PositionGetTicket(i);                                                                                                                                    // Get [i]th position's ticket number
                //+-------------------------------------------------------------------------------------------------------------------------+
                //| Filter if ticket is for mSymbol and mMagicTPA_FTT. If not continue next position in the loop
                //+-------------------------------------------------------------------------------------------------------------------------+
                        if(PositionGetString(POSITION_SYMBOL) != mSymbol && PositionGetInteger(POSITION_MAGIC) != mMagic5003)                                           continue;

            if(ticket > 0) {                                                                                                                                                                                                                    // [i]th Position found to process

Now this is closing trade from mMagic5002 strategy ...