horizontal lines based on zigzag keep disappearing
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.
@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