Order modify

 
                if( dir == LONG ) {
                  if ( OrderModify(ticket, 0, OrderOpenPrice()-sl, OrderOpenPrice()+tp, 0) ) {
                      Print("OpenTrade: SL/TP are set LONG");
                      Screenshot("OpenTrade_SLTP");
                      break;
                  }
                }
                
                if( dir == SHORT ) {
                  if ( OrderModify(ticket, 0, OrderOpenPrice()+sl, OrderOpenPrice()-tp, 0) ) {
                      Print("OpenTrade: SL/TP are set SHORT");
                      Screenshot("OpenTrade_SLTP");
                      break;
                  }                
                }

I have changed my EA to open long and short order at a time what ever may be the scenario( bull or bear). my stoploss is 50 pips & take profit is 150 pips all is being set correct.

But now I want that in bull scenario my long positon stoploss 50 pips & take profit 150 ( this will set automatically as per my EA) issue is I want to set my Short position take profit to 50 pips instead of 150 pips & viceversa in bear scenario.

Stop loss & take profit set in modify order code for which I have given code above.

Can you please help me on code to achieve this.

 
 

Hi Ubzen,

Thanks but I see that person who have worked more on Job also selling his EA. So I think its matter of security of logic which I want to use in EA.

 
kcfve123: Thanks but I see that person who have worked more on Job also selling his EA. So I think its matter of security of logic which I want to use in EA.

It'll be hard for anyone to help you blind-folded.

I have a feeling you're not a programmer.

Reason: