You calling DrawLevels, before populating SRlevel.
Thanks
void DrawLevels(double price,int count) { string name = InpPrefix + IntegerToString(count); if(price == 0) { ObjectDelete(0, name); } if(ObjectFind(0, name)<0) { ObjectCreate(0,name,OBJ_HLINE, 0, 0, price); ObjectSetInteger(0, name, OBJPROP_COLOR,InpLineColour); ObjectSetInteger(0, name, OBJPROP_WIDTH,InpLineWeight); ObjectSetInteger(0,name,OBJPROP_BACK,true); } else { ObjectSetDouble(0,name,OBJPROP_PRICE,price); } ChartRedraw(0); }
if you want to see objects created by an Indicator within an EA, you will have to manually attach the indicator to the chart using ChartIndicatorAdd() in the OnInit() of the EA. Then you need to do IndicatorRelease(handle) in OnDeInit of the expert advisor.

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
@Vladimir Karputov Alain Verleyen William Roeder
I have zigzag based indicator. The code makes sense to me but the objects(HLINE) drawn on screen keep disappearing, please help