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
OnDeInit TimeToString: jj is not the datetime of the bar.
Anyway it makes more sense to iterate over the objects attachted to the chart as suggested by forex2start.
Because I think there are always less objects than bars.
Uwe
OnDeInit TimeToString: jj is not the datetime of the bar.
Anyway it makes more sense to iterate over the objects attachted to the chart as suggested by forex2start.
Because I think there are always less objects than bars.
Uwe
OnDeInit TimeToString: jj is not the datetime of the bar.
thank you. i fix it .
. . TOTAL_BAR=rates_total; . . //+------------------------------------------------------------------+ //| Function for drawing a trend line in the indicator window | //+------------------------------------------------------------------+ void DrawIndicatorTrendLine(int bar,datetime x1,datetime x2,double y1,double y2,color lineColor,int style) { int indicatorWindow=ChartWindowFind(0,short_name); // short_name indicatorName if(indicatorWindow<0) return; string label="AO_Indicator_Divergence"+IntegerToString(bar)+TimeToString(x2); if(ObjectFind(0,label)==-1) { ObjectCreate(0,label,OBJ_TREND,indicatorWindow,x1,y1,x2,y2); ObjectSetInteger(0,label,OBJPROP_COLOR,lineColor); ObjectSetInteger(0,label,OBJPROP_STYLE,style); ObjectSetInteger(0,label,OBJPROP_WIDTH,0); ObjectSetInteger(0,label,OBJPROP_RAY,0); ObjectSetInteger(0,label,OBJPROP_BACK,false); } else { ObjectMove(0,label,0,x1,y1); ObjectMove(0,label,1,x2,y2); } } //----------------------------------------------------------------------------------------------------------// //+------------------------------------------------------------------+ //| Function for drawing a trend line in a price chart window | //+------------------------------------------------------------------+ void DrawPriceTrendLine(int bar,datetime x1,datetime x2,double y1,double y2,color lineColor,int style) { string label="AO_Price_Divergence"+IntegerToString(bar)+TimeToString(x2); if(ObjectFind(0,label)==-1) { ObjectCreate(0,label,OBJ_TREND,0,x1,y1,x2,y2); ObjectSetInteger(0,label,OBJPROP_COLOR,lineColor); ObjectSetInteger(0,label,OBJPROP_STYLE,style); ObjectSetInteger(0,label,OBJPROP_WIDTH,0); ObjectSetInteger(0,label,OBJPROP_RAY,0); ObjectSetInteger(0,label,OBJPROP_BACK,false); } else { ObjectMove(0,label,0,x1,y1); ObjectMove(0,label,1,x2,y2); } } //----------------------------------------------------------------------------------------------------------//
&
Anyway it makes more sense to iterate over the objects attachted to the chart as suggested by forex2start.
Because I think there are always less objects than bars.
yes , is this make error?
compiling has no error or warning
but chart have problem.
===================================================
when i use :
there is no problem.
but when i inactive it by comment it & active 2 for(...) in " void OnDeinit(const int reason) " as like as shown in above , chart have problem. below pic.
how can fix this problem?
thank you.
...how can fix this problem?
thank you.
ObjectDelete() is a function, it return a value, you have to check this value to build robust code.
Your loops in DeInit() don't give you the right name for your objects. This is why you get problem.
Try this way :
Compiled but not tested.
ObjectDelete() is a function, it return a value, you have to check this value to build robust code.
Your loops in DeInit() don't give you the right name for your objects. This is why you get problem.
Try this way :
Compiled but not tested.
thank you for new & right way;
but still have problem: (pic. below)
can you please check if no need to :
and it also have problem.
thank you for new & right way;
but still have problem: (pic. below)
can you please check if no need to :
and it also have problem.
There is no need to use third parameter for ObjectName to -1, as this is the default value.
Sorry, I have not paid enough attention to your issue, try this way :
There is no need to use third parameter for ObjectName to -1, as this is the default value.
Sorry, I have not paid enough attention to your issue, try this way :
?
There is no need to use third parameter for ObjectName to -1, as this is the default value.
Sorry, I have not paid enough attention to your issue, try this way :
thank you
angevoyageur
forex2start
ugo58
THANK YOU ALL
problem solved.