Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
Hi All, as a newbie with mt5, I tried to write an ea an get error saying invalid stops, here is the code of my ea for opening position:
Please insert the code correctly: when editing a message, press the button and paste your code into the pop-up window. (The first time I corrected your message)
Print your SL, PT and prices of the order, bid and ask and check whether they all are placed well and have the rquested distance acc. to the specifications <= this check should be done by your EA before it sends any order!
Thanks Carl,
The thing is: stop loss = 0, I don't want to set a stop loss.
Please insert the code correctly
Thanks Vladimir,
here it is;
input group "Trading Settings" input ENUM_LOT_MOD LM = LM_Fixed; //LotSize Type input double LOT = 0.2; //LotSize: Fixed input double RiskPercentage = 1; //LotSize: % of Balance input double StoplossInPips = 0; //Stoploss(in Points, 0=no stoploss) input double TakeprofitInPips = 2.5; //Takeprofit(in Points, 0=Take profit) input ENUM_TIMEFRAMES TF_W=PERIOD_M1;//Working Timeframe input bool TF_H_E=true;//Use Higher Timeframe input ENUM_TIMEFRAMES TF_H=PERIOD_M5;//Higher Timeframe int Slippage = 50; //Slippage input bool CloseIfOppositeSignal = true; //Close trades when opposite signal input bool ClosedCandle = true; //Open trades when candle closed
That is not code, those are variables. How you use them is important. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All, as a newbie with mt5, I tried to write an ea an get error saying invalid stops, here is the code of my ea for opening position: