Hi guys,
We usually use ontick() function to make EA run on every tick. Or we use ontimer() to make EA run on x amount of time.
Can we use something to make EA run on movement of 1 pip (or lets say x amount of pips)?
Regards,
Saurabh
- How to run EA on every second instead of ontick?
- Indicators: DRAW_BARS
- Can I run Ontick function for multiple times within one run?
Of course if you code it to do that.
Marco vd Heijden:
Of course if you code it to do that.
Thanks for confirming Marco.Of course if you code it to do that.
Honestly, I am not a coder. I am a finance guy but trying to learn mql5 language.......mostly through online tutorials and with help of this amazing forum.
I googled a lot but couldn't find any script or tutorial which can run EA on every pip basis. I would be extremely grateful if you could explain logic about how to code it. Thanks 🙏
saurabhB: I googled a lot but couldn't find any script or tutorial which can run EA on every pip basis. I would be extremely grateful if you could explain logic about how to code it. Thanks 🙏
Of course, you didn't find it. You already know you only run on tick or on timer. You have to code a filter in on tick for your distance.
MT4: Learn to code it.
MT5: Begin learning to code it.
If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2019.08.21
saurabhB:
Thanks for confirming Marco.
Thanks for confirming Marco.
Honestly, I am not a coder. I am a finance guy but trying to learn mql5 language.......mostly through online tutorials and with help of this amazing forum.
I googled a lot but couldn't find any script or tutorial which can run EA on every pip basis. I would be extremely grateful if you could explain logic about how to code it. Thanks 🙏
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- if(!PipChange()) return; } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool PipChange() { static double price,prePrice=0,curPrice,muldiv=MathPow(10,_Digits-1),pipdbl=_Point*10; price=SymbolInfoDouble(_Symbol,SYMBOL_BID); //--- if(price>prePrice && (curPrice=MathFloor(price*muldiv)/muldiv)-prePrice>pipdbl) { prePrice=curPrice; return(true); } //--- else if(price<prePrice && prePrice-(curPrice=MathCeil(price*muldiv)/muldiv)>pipdbl) { prePrice=curPrice; return(true); } //--- return(false); } //+------------------------------------------------------------------+
Ernst Van Der Merwe:
Thank you so much Ernst Van Der Merwe. 🙏🙏
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register