Does anybody know?
You'll should provide more details in your code (and format as such).
For example, are you Initiating a chart window of your own? Have you tried that? Code will tell. Those 2 lines alone do not describe the context well enough.
You'll should provide more details in your code (and format as such).
For example, are you Initiating a chart window of your own? Have you tried that? Code will tell. Those 2 lines alone do not describe the context well enough.
Thank you for your reply. The code goes like this:
void OnInit()
{
avg_handle = iAMA(_Symbol,_Period,ama_period, ama_fast_period, ama_slow_period, 0,PRICE_WEIGHTED);
long id = ChartID();
if(id <= 0)
{
id = ChartOpen(_Symbol, _Period);
}
if(id != 0)
{
//--------------the following code does not work during simulation ------------------------
ObjectSetInteger(id,"start", OBJPROP_COLOR, Yellow);
ChartIndicatorAdd(0,0,avg_handle);
ChartSetInteger(0,CHART_SHOW_PERIOD_SEP,1); }
}
Please help. Thanks!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In MT4, I can show VLine when doing the strategy test. Now with MT5, seem the ChartWindow does not exist when doing the strategy test, so the VLine cannot be displayed.
ObjectCreate(0, s, OBJ_VLINE, 0, t, 0);
ObjectSetInteger(0,s, OBJPROP_COLOR, vcolor);
This does not work during strategy test. Can anyone help me ?
Thanks