ordermodify , how can i do? I want to change value modified to non-value

 

Hello , I have a question.

 

 example

                             

1 2012.11.27 12:00 sell     249   0.01  1.29611    0.00000     1.29284     0.00  10026.26

2 2012.11.27 12:30 modify 249 0.01 1.29611 1.30013 1.29017 0.00 10026.26

3 2012.11.27 16:31 modify 249 0.01 1.29611 1.29739 1.28970 0.00 10026.26


I want to  change green T/p (1.28970) to non value(0.00000) .  I tried like below.

After I had declared a variable NonTP, I tried modify. 

but T/p modified would not be changed to 0.00000

Could you tell me how ? 

I'm looking forward to answer.

Please understand my bad english.

   double NonTP = 0.00000;
   for(int i=1; i<=OrdersTotal(); i++)
      {
      if(every_4H != iTime(Symbol(),PERIOD_H4,0))
      {
      
      if (OrderSelect(i-1,SELECT_BY_POS)==true)
         {
         double OOP = OrderOpenPrice();
         int OT = OrderTicket();
         double OL = OrderLots();
         if((H4_P<H4_P2)&&(OrderType() == OP_BUY))
         {
         OrderClose(OT,OL,Bid,3);
         }
         if((H4_P>H4_P2)&&(OrderType() == OP_SELL))
         {
         OrderClose(OT,OL,Ask,3);
         }
         if((Ask>=H4_R10)&&(OrderType() == OP_BUY))
            {
            OrderModify(OT,OOP,H4_S15,H4_R30,0,Blue);
            return;
            }
         if((Ask>=H4_R20)&&(OrderType() == OP_BUY))
            {
            OrderModify(OT,OOP,H4_S05,NonTP,0,Blue);
            return;
            }   
            
            
         if((Bid<=H4_S10)&&(OrderType() == OP_SELL))
            {
            OrderModify(OT,OOP,H4_R15,H4_S30,0,Blue);
            return;
            }
         if((Bid<=H4_S20)&&(OrderType() == OP_SELL))
            {OrderModify(OT,OOP,H4_R05,NonTP,0,Blue);
            return;
            }
         }
         }
      
      }      
   
 
kjwoong001:

Hello , I have a question.

 

 example

                             

1 2012.11.27 12:00 sell     249   0.01  1.29611    0.00000     1.29284     0.00  10026.26

2 2012.11.27 12:30 modify 249 0.01 1.29611 1.30013 1.29017 0.00 10026.26

3 2012.11.27 16:31 modify 249 0.01 1.29611 1.29739 1.28970 0.00 10026.26


I want to  change green T/p (1.28970) to non value(0.00000) .  I tried like below.

After I had declared a variable NonTP, I tried modify. 

but T/p modified would not be changed to 0.00000

Could you tell me how ? 

I'm looking forward to answer.

Please understand my bad english.


As we have no clue what values your H4_ variables have, we can only guess.
I guess this has been executed:

         if((Bid<=H4_S10)&&(OrderType() == OP_SELL))
            {
            OrderModify(OT,OOP,H4_R15,H4_S30,0,Blue);
            return;
            }
Some Print() statements will help you to find it out
 
kjwoong001:

Hello , I have a question.

I want to  change green T/p (1.28970) to non value(0.00000) .  I tried like below.

After I had declared a variable NonTP, I tried modify. 

but T/p modified would not be changed to 0.00000

Don't you want to know if your OrderModify() works or not ?  and if it fails don't you want to know why ?  don't you want to know what the relevant variables were when it failed ?

Read this:  What are Function return values ? How do I use them ?
 
kronin:


As we have no clue what values your H4_ variables have, we can only guess.
I guess this has been executed:

Some Print() statements will help you to find it out

 

 

 

 


Hello, Kronin^^

I know why.

I solved the problem thanks to you.

Thank you. 

 
RaptorUK:
Don't you want to know if your OrderModify() works or not ?  and if it fails don't you want to know why ?  don't you want to know what the relevant variables were when it failed ?

Read this:  What are Function return values ? How do I use them ?


oh,, Hello RaptorUK.

I'am reading  the article you suggested.

Thank you for good information!

Reason: