
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
- Double Exponential Moving Average - Trend Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis
- Enabling the Storage - Projects and MQL5 Storage
- Viewing project history - Projects and MQL5 Storage
vzlademd:
Hello, I have a crossover ea of 2 EMAs, but what I need is that when the 4 period ema crosses the 100 ema the command 50pips will open after having crossed, currently the robot that I have opens it immediately, I made some modifications using a double variable called Preciobuy and another PrecioSell that saves the price so that when the bid is above that value, it will mount the operation but it doesn't work for me, I don't know what to do .. please help.
I will leave my code so that you can see it and you can help me:
Hello,
need to put the new variables on Start() function.
Like this...
double Preciobuy=0; double Preciosell=0; double preciobuy2=0; double preciosell2=0; //+------------------------------------------------------------------+ // expert start function //+------------------------------------------------------------------+ int start() { double MyPoint=Point; if(Digits==3 || Digits==5) MyPoint=Point*10; double TheStopLoss=0; double TheTakeProfit=0; //--- Preciobuy=iMA(NULL,0,100,0,MODE_EMA,PRICE_CLOSE,0); Preciosell=iMA(NULL,0,100,0,MODE_EMA,PRICE_CLOSE,0); preciobuy2=Preciobuy+50*MyPoint; preciosell2=Preciosell-50*MyPoint; //--- ........................ }

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
Thansks!! Nikolaos Pantzos

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