increase TakeProfit after get stoplose..

Back to topics list To post a new topic, please log in or register
avatar
3
goldbell 2015.06.25 09:03
 
void CheckIfOrderEarned()
   {
  
   int i=OrdersHistoryTotal()-1;
   //----
   OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
      {                                    
      OT = OrderType();
      OL = OrderLots();
      SL = OrderStopLoss();
      TP = OrderTakeProfit();
      _symbol = OrderSymbol();
      double OP = OrderProfit();
       double OOP = OrderOpenPrice();

     
      if (OrderMagicNumber() == Magic)
         {
    
  

     if (OrderProfit() <0 && OrderLots() < NormalizeDouble(templots*3,2))
     {
  
     if (OrderLots()==Lots && MathAbs((TP-OOP)/Point) <= TempProfit*3 )
     {
   
          TakeProfit = MathAbs((TP-OOP)/Point)+TempProfit;
      
         }   
        
              
    }
         

else
            {
          //  TakeProfit= 20;
            Lots = templots;
            TakeProfit = TempProfit;
            }
            
                          
         }
      }

   }



i want condition like this:

1 first open using lot 0.1 and tp 20 pips, get sl..

2. open second still using lot 0.1, but tp increase be 40, get sl..

3. open third still using lot 0.1, tp be 60, get sl.

4. because have 5 times get sl, & increase tp


5.........


i can increase lot double every get sl, and profit double every get sl..

but i can not make every lot have 3 level tp incerement..

because that code i make, that result increase lot and tp together when get sl..


what should i change the code?
thx..





avatar
13001
WHRoeder 2015.06.25 13:54 #
 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
avatar
313
JD4 2015.06.27 05:56 #
 
From my side, it looks like they did use the SRC button, or did a mod put that in the box?  Not speaking to specific details of what you want the program to do, because IDK MQL all that much, but from a coder/programmer standpoint, you might want to make sure the code you post is aligned properly (i.e. opening and closing braces are not further indented than the code they are enclosing).  It helps other people follow your program and spot possible errors easier.
avatar
13001
WHRoeder 2015.06.27 13:50 #
 
JD4: From my side, it looks like they did use the SRC button, or did a mod put that in the box? 
Edited after my post.

avatar
313
JD4 2015.06.27 19:51 #
 
WHRoeder:
JD4: From my side, it looks like they did use the SRC button, or did a mod put that in the box? 
Edited after my post.

Ah.
avatar
3
goldbell 2015.07.10 20:44 #
 
void CheckIfOrderEarned()
   {
  
   int i=OrdersHistoryTotal()-1;
   //----
   OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
      {                                    
      OT = OrderType();
      OL = OrderLots();
      SL = OrderStopLoss();
      TP = OrderTakeProfit();
      _symbol = OrderSymbol();
      double OP = OrderProfit();
       double OOP = OrderOpenPrice();

     
      if (OrderMagicNumber() == Magic)
         {
    
  

     if (OrderProfit() <0 && OrderLots() < NormalizeDouble(templots*3,2))
     {
  
     if (OrderLots()==Lots && MathAbs((TP-OOP)/Point) <= TempProfit*3 )
     {
   
          TakeProfit = MathAbs((TP-OOP)/Point)+TempProfit;
      
         }   
        
              
    }
         

else
            {
          //  TakeProfit= 20;
            Lots = templots;
            TakeProfit = TempProfit;
            }
            
                          
         }
      }

   }
avatar
3
goldbell 2015.07.10 20:46 #
 

i want condition like this:

1 first open using lot 0.1 and tp 20 pips, get sl..

2. open second still using lot 0.1, but tp increase be 40, get sl..

3. open third still using lot 0.1, tp be 60, get sl.

4. because have 5 times get sl, & increase tp


5.........


i can increase lot double every get sl, and profit double every get sl..

but i can not make every lot have 3 level tp incerement..

because that code i make, that result increase lot and tp together when get sl..


what should i change the code?
thx..
Back to topics list  

To add comments, please log in or register