Sathish Justin:
My stoploss code is as below, once stoploss is hit, next 15 mins EA should stop trading, how should i modify the below code
Does not compute...
This is how someone with MT4 might do it.
// MT4 read last closed trade profit or loss and check if its closed time is less than 15 minutes if (LastProfit()) return(0); // exit when condition is true. It is reset proof, ie. the platform can be restarted bool LastProfit() { double profit; datetime closetime=TimeCurrent(); for (int pos=OrdersHistoryTotal()-1; pos>=0; pos--) { if (OrderSelect(pos,SELECT_BY_POS, MODE_HISTORY)==TRUE && OrderMagicNumber()==MAGIC && OrderSymbol()==Symbol()) { if (OrderType()== OP_BUY || OrderType()== OP_SELL) { profit=OrderProfit(); closetime=OrderCloseTime(); } } } if(profit < 0 && (TimeCurrent()-closetime) < 15*60) return(true); // return true when time is less than 15 minutes ago ie. 15*60seconds else return(false); }

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
My stoploss code is as below, once stoploss is hit, next 15 mins EA should stop trading, how should i modify the below code