Hello,
Take a look at "Options" menu on "Experts Advisor"
janareza:Hello.When I run an expert on a chart, whenever I change the time frame, the expert runs again. What is the problem?
There is no problem. That is normal! Every time the chart changes time-frame or symbol, all Indicators and EAs on it will be restarted.
You need to program your EA to take that into account.
Fernando Carreiro #:
There is no problem. That is normal! Every time the chart changes time-frame or symbol, all Indicators and EAs on it will be restarted.
You need to program your EA yo take that into account.
Thank you.
I wrote the expert in int OnInit() function. In wich function should i write the command so that it is excuted only once?
int OnInit() { MqlTradeRequest request={1}; MqlTradeResult result={0}; request.symbol =Symbol(); double price; double stoplimit; double point=SymbolInfoDouble(_ Symbol,SYMBOL_POINT); int digits=SymbolInfoInteger(_ Symbol,SYMBOL_DIGITS); request.action =TRADE_ACTION_PENDING; request.type=ORDER_TYPE_SELL_LIMIT; request.volume =1; price =SymbolInfoDouble(Symbol(), SYMBOL_BID)+(point*100); request.price=NormalizeDouble( price,digits); if(!OrderSendAsync(request, result)) PrintFormat("OrderSend error %d",GetLastError()); return(INIT_SUCCEEDED); }
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
Hello.
When I run an expert on a chart, whenever I change the time frame, the expert runs again. What is the problem?