My result is just like this. The lines going are endless to the bottom instead connecting each point to a line. (Red)
You are missing the second price and time for the trend line that you are using and you have to limit that trend line not to extend beyond the two points that you want it to draw from-to. For that you have to change the trend line ray property
Do something like this :
ObjectSet( "movav" + mytime, OBJPROP_RAY,false);
ObjectCreate( "movav" + mytime, OBJ_TREND, 0, Time[0], indicator );
It must have 2 times and 2 prices coordinats. Like this.
ObjectCreate( "movav" + mytime, OBJ_TREND, 0, Time[1], 1.2253 ,Time[0],1.2255);
You are missing the second price and time for the trend line that you are using and you have to limit that trend line not to extend beyond the two points that you want it to draw from-to. For that you have to change the trend line ray property
Do something like this :
ObjectSet( "movav" + mytime, OBJPROP_RAY,false);
and for current bar he needs
ObjectMove( "movav" + mytime,0, Time[0], indicatorValueNow);
ObjectMove( "movav" + mytime,1, Time[1], indicatorValuePreviousBar);
double MA8_0; double MA8[]; int maNameNumber; void OnTick() { drawMA(); ChartRedraw(0); } int OnInit() { maNameNumber = 0; maNameNumber = "A"; MA8_0 = iMA(_Symbol, timeframe, 8, 0, MODE_EMA, PRICE_CLOSE); ArraySetAsSeries(MA8,true); } void drawMA(){ int MA_Thinkness = 3; CopyBuffer(MA8_0,0,0,3,MA8); if (NewBar() || maName == "A"){ maNameNumber++; maName = IntegerToString(maNameNumber); } else{ maName = maName; } ObjectCreate( 0,maName+"8" ,OBJ_TREND ,0, iTime(_Symbol,timeframe,1), MA8[1],iTime(_Symbol,timeframe,0), MA8[0] ); ObjectSetInteger(0, maName+"8", OBJPROP_RAY,false); ObjectSetInteger(0, maName+"8", OBJPROP_COLOR,clrMagenta); ObjectSetInteger(0, maName+"8", OBJPROP_WIDTH,MA_Thinkness); }
enjoy ;)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My result is just like this. The lines going are endless to the bottom instead connecting each point to a line. (Red)