Pip counter

Theodor Girtan
17
Theodor Girtan  

Hi guys,i'm new to mql4 programming and i want to make a "sort of" martingale system.

Right now the code looks like this

void OnTick()

{if(OrdersTotal()==0)

  {OrderSend(

      _Symbol,             

      OP_BUY,                 

      0.01,              

     Ask,               

     3,            

   Ask-90000*Point,            

    Ask+90000*Point,          

    NULL,        

     0,             

     0,        

    clrRed

   );}

   if(OrdersTotal()==1){

   OrderSend(_Symbol,OP_SELL,0.01,Bid,3,Bid+90000*Point,Bid-90000*Point,NULL,0,0,clrGreen);}

   

}

 So,i don't know how to code the part in which after a set number amount of pips it opens a new position.

How to Order a Trading Robot in MQL5 and MQL4
How to Order a Trading Robot in MQL5 and MQL4
  • www.mql5.com
With the launch of the Freelance service, the MQL5.community has become an ideal place for placing orders and providing programming services. Thousands of traders and developers visit this resource on a daily basis, and they can easily help each other. For traders, the Jobs service is the opportunity to easily obtain their own Expert Advisors. For an MQL5 developer, it is an opportunity to easily find a client. In this article, we will consider the capabilities of this service.
William Roeder
24220
William Roeder  
Theodor Girtan: i'm net to mql4 programming and i want to make a "sort of" martingale system.
  1. Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  3. Hedging, grid trading, same as Martingale.
              Martingale, Hedging and Grid : MHG - General - MQL5 programming forum 2016.12.20

    Martingale, guaranteed to blow your account eventually. If it's not profitable without, it is definitely not profitable with.
              Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum 2015.02.11

    Why it won't work: Calculate Loss from Lot Pips - MQL5 programming forum 2017.07.11

  4. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help 2017.04.21

Theodor Girtan
17
Theodor Girtan  
William Roeder:
  1. Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  3. Hedging, grid trading, same as Martingale.
              Martingale, Hedging and Grid : MHG - General - MQL5 programming forum 2016.12.20

    Martingale, guaranteed to blow your account eventually. If it's not profitable without, it is definitely not profitable with.
              Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum 2015.02.11

    Why it won't work: Calculate Loss from Lot Pips - MQL5 programming forum 2017.07.11

  4. You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help 2017.04.21




I dont need for someone to code it for me,i just want some advices on how i can do that and i'll code it myself.
Keith Watford
Moderator
28022
Keith Watford  
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.