Please see
ChartSetSymbolPeriod();
i insert this ChartSetSymbolPeriod(0,NULL,30); inside the start but freez metatrader
and i must kill with task manager
You want to switch to M30 once or an infinite number of times ?
That's like pressing the same button over and over and over of course it's going to freeze.
Obviously you put it in Oninit() function.
if(Period() != PERIOD_M30) { ChartSetSymbolPeriod(0,Symbol(),PERIOD_M30); }But be careful in the tester it can not switch a time frame.
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 |...
if i use EA work thankz
but i ahave a little problem after this if i want set H1 and i call shift=iBarShift(Symbol(),PERIOD_CURRENT,some_time); return number bar like if i set time frame 30 min
in deint i use only
ObjectsDeleteAll(0,OBJ_TEXT); return(0);
exist some command for deint all and clean, becuase i suppose when i rerun a script not remove the setup
bho
thankz
use ObjectFind() and ObjectDelete() before ObjectCreate()
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 guys exist a command for set timeframe on thefly when i add indicator ?
example when i write script and clic over play in metaeditor in default , it set me H1 but if i want set M30 ? on the fly ?
i look
ChartSetInteger
in hcart propertuy but not find nothing is possible ?
thankz