if(Bid-500*Point>Open[0] || Bid+500*Point<Open[0]) Alert("500");
Vasyl Nosal:
Thanks, but something like this :
// fxono.mq4 #property version "1.0" #property strict #define MAGICMA 6666 //--- Inputs input double Lot =1; input int sl = 50; input int tp = 50; //+------------------------------------------------------------------+ //| Check for open order conditions | //+------------------------------------------------------------------+ void CheckForOpen() { double ma; int res; // Here set last 500 pips level (How do it in mql4?)!!!!!!!!!!!!!!!!! ma= iOpen(NULL,PERIOD_W1,0); if(Open[1]<ma && Close[1]<ma) { res=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,ma + sl*Point*10,Bid - tp*Point*10,"",MAGICMA,0,Red); return; } //--- buy conditions if(Open[1]>ma && Close[1]>ma) { res=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,ma - sl*Point*10,Ask + tp*Point*10,"",MAGICMA,0,Blue); return; } } void OnTick() { if(Bars<100)return; if(OrdersTotal() == 0)CheckForOpen(); }
But this
ma= iOpen(NULL,PERIOD_W1,0);
change to last 500 pips level.
How to do it?
Nice day.
fxono:
You should specify what you mean by 500 pips level, provide example(s).
Thanks, but something like this :
But this
change to last 500 pips level.
How to do it?
Nice day.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi,
how check what 500 pips level was last time?
I need set buy if last 500pips level was below curent open bar and sell when was above current bar open.
I have got something like this :
(Please excuse any errors in english.)