Stop deleting and recreating the line each tick.
first determine the trending condition. then draw trend and confirm trend drawn and skip the drawn i.e. confirmed condition..
void OnTick() { if (!drawn) { if (checkcondition()) { // ..... draw // drawn=true; } } }
Mustafa Damgaci #:
first determine the trending condition. then draw trend and confirm trend drawn and skip the drawn i.e. confirmed condition..
here i make one condition that make Downtrend , I not delete this trend ,
int highestCandle = iHighest(Symbol(),0,MODE_HIGH,500,0); if( High[highestCandle] > High[5] ) { ObjectCreate(0,"HT",OBJ_TREND,0,Time[highestCandle],High[highestCandle],Time[0],High[0]); ObjectSetInteger(0,"HT",OBJPROP_COLOR,clrBlue); ObjectSetInteger(0,"HT",OBJPROP_STYLE,STYLE_SOLID); ObjectSetInteger(0,"HT",OBJPROP_RAY,true); }
but this downtrend never again appear when next condition meet again.
How can redraw it?
How can I solve this ?
If this is due to object name, need to set new name whenever meet condition.how can do it.
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
I want to draw trendline on chart,
example I drawl uptrend line ,
it coordinate points need to be static , it mean dont want to move whenever coordinate point value change,because we write the code as follow
this make a uptrendline as picture,
as all we know this two coordinate points are moving as wrote in codes,
I want to be static this coordinate point , So we can call breakout trendline entry, if coordinate points are moving , we cannot get real entry points.
How can do that my friends.