How can I fix this chart

Some charts appear this way, but others appear well
Is there a measurement of the painting fixed ?
%D9%A2%D9%A0%D9%A1%D9%A8-%D9%A0%D9%A8-%D9%A3%D9%A1%20at%20%D9%A0%D9%A3-%D9%A4%D9%A2-%D9%A4%D9%A4

hello

Somewhere in your code you have the Plot function
https://www.amibroker.com/guide/afl/plot.html

The 4rth parameter of plot function is the style.
styleNoRescale will do the job your you

many examples are in this forum
https://forum.amibroker.com/search?q=styleNoRescale%20

2 Likes

Hi
When I delete the trend, the chart changes how to make it steady

x0AH1 = starthitimeH;
x1BH2 = secondhitimeH ;
y0AH1  = RRR[AH1] ;
y1BH2 = RRR[BH2];
//Plot( LineArray( x0AH1, y0AH1, x1BH2  ,y1BH2, True , True ), "", colorGrey40 , styleDashed| styleNoLabel);




x0BH2 =secondhitimeH ;
x1CH3 = thirdhitimeH;
y0BH2  = RRR[BH2] ;
y1CH3 = RRR[CH3];
//Plot( LineArray(x0BH2, y0BH2 , x1CH3  ,y1CH3 , True , True ), "", colorGrey40 , styleDashed| styleNoLabel);

%D9%A2%D9%A0%D9%A1%D9%A8-%D9%A0%D9%A9-%D9%A0%D9%A2%20at%20%D9%A2%D9%A0-%D9%A0%D9%A0-%D9%A1%D9%A5

When I re-draw the trend the problem return
%D9%A2%D9%A0%D9%A1%D9%A8-%D9%A0%D9%A9-%D9%A0%D9%A2%20at%20%D9%A2%D9%A0-%D9%A0%D9%A2-%D9%A5%D9%A1

I added "styleNoRescale" and the problem is still the same

@iSaleh Posting such code:

Err

...and expecting that somebody will help you, makes no sense. Nobody can verify your code. You should try harder and prepare a working example ...

@PanoS gave you good advice (not seeing your code), but if you are using LineArray() it's a different story..

1 Like
/*_SECTION_BEGIN("RSI");
//periods = Param( "Periods", 14, 1, 200, 1 );
Plot( RSI(14), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style")  );
*/
dist = 0.01 * ATR( 20 );
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("ÊÑäÏ");
//inputArray = Close;



//inputArray = Close;
TP = Param("Trend Per", 500,2,1000);


//=============================================================================================
RRR=h;

//=============================================================================================


startvalueH = LastValue( HHV( RRR, TP ) );
starthitimeH = LastValue( ValueWhen( RRR== startvalueH, BarIndex(), 1) );
HBP = BarCount - starthitimeH;
PlotText("1",starthitimeH, rrr[starthitimeH], colorRed, bkcolor = colorDefault);



secondvalueH= LastValue( HHV( RRR, HBP -2) );
if(secondvalueH<startvalueH );
{
secondhitimeH = LastValue( ValueWhen( RRR== secondvalueH, BarIndex(), 1) );
HBP2 = BarCount - secondhitimeH;
PlotText("2",secondhitimeH, rrr[secondhitimeH], colorRed, bkcolor = colorDefault);
}


thirdvalueH = LastValue( HHV( RRR, HBP2 -2 ) );
if(thirdvalueH <secondvalueH );
{
thirdhitimeH = LastValue( ValueWhen( RRR== thirdvalueH, BarIndex(), 1) );
HBP3 = BarCount - thirdhitimeH;
PlotText("3",thirdhitimeH, rrr[thirdhitimeH], colorRed, bkcolor = colorDefault);
}



fourthvalueH = LastValue( HHV( RRR, HBP3 -2) );
if(fourthvalueH<thirdvalueH  );
{
fourthhitimeH = LastValue( ValueWhen( RRR==fourthvalueH, BarIndex(), 1) );
HBP4 = BarCount - fourthhitimeH;
PlotText("4",fourthhitimeH, rrr[fourthhitimeH], colorRed, bkcolor = colorDefault);
}


fifthvalueH = LastValue( HHV( RRR, HBP4 - 2 ) );
if(fifthvalueH <fourthvalueH  );
{
fifthhitimeH = LastValue( ValueWhen( RRR==fifthvalueH, BarIndex(), 1) );
HBP5 = BarCount - fifthhitimeH;
PlotText("5",fifthhitimeH, rrr[fifthhitimeH], colorRed, bkcolor = colorDefault);
}

sixthvalueH = LastValue( HHV( RRR, HBP5 - 2 ) );
if( sixthvalueH<fifthvalueH );
{
sixthhitimeH = LastValue( ValueWhen( RRR==sixthvalueH, BarIndex(), 1) );
HBP6 = BarCount - sixthhitimeH ;
PlotText("6",sixthhitimeH, rrr[sixthhitimeH], colorRed, bkcolor = colorDefault);
}


seventhvalueH = LastValue( HHV( RRR, HBP6 -2) );
if( seventhvalueH<sixthvalueH );
{
seventhhitimeH= LastValue( ValueWhen( RRR==seventhvalueH, BarIndex(), 1) );
HBP7 = BarCount - seventhhitimeH;
PlotText("7",seventhhitimeH, rrr[seventhhitimeH], colorRed, bkcolor = colorDefault);
}



eighthvalueH = LastValue( HHV( RRR, HBP7 -2 ) );
if(eighthvalueH <seventhvalueH );

{
eighthhitimeH= LastValue( ValueWhen( RRR==eighthvalueH , BarIndex(), 1) );
HBP8 = BarCount -eighthhitimeH;
PlotText("8",eighthhitimeH, rrr[eighthhitimeH], colorRed, bkcolor = colorDefault);
}


ninthvalueH = LastValue( HHV( RRR, HBP8 -2) );
if( ninthvalueH  <eighthvalueH);
{
ninthhitimeH= LastValue( ValueWhen( RRR==ninthvalueH, BarIndex(), 1) );
HBP9 = BarCount - ninthhitimeH;
PlotText("9",ninthhitimeH, rrr[ninthhitimeH], colorRed, bkcolor = colorDefault);
}
//=============================================================================================



AH1 =starthitimeH;
BH2= secondhitimeH ;
CH3=thirdhitimeH;
DH4=fourthhitimeH ;
EH5=fifthhitimeH;
FH6=sixthhitimeH  ;
GH7=seventhhitimeH;
HXH8=eighthhitimeH;
IH9=ninthhitimeH;

AHV1=startvalueH ;
BHV2=secondvalueH;
CHV3=thirdvalueH ;
DHV4=fourthvalueH ;
EHV5=fifthvalueH ;
FHV6=sixthvalueH;
GHV7=seventhvalueH ;
HXHV8=eighthvalueH ;
IHV9=ninthvalueH;







x0AH1 = starthitimeH;
x1BH2 = secondhitimeH ;
y0AH1  = RRR[AH1] ; 
y1BH2 = RRR[BH2]; 
Plot( LineArray( x0AH1, y0AH1, x1BH2  ,y1BH2, True , True ), "", colorGrey40 , styleDashed| styleNoLabel);




x0BH2 =secondhitimeH ;
x1CH3 = thirdhitimeH;
y0BH2  = RRR[BH2] ; 
y1CH3 = RRR[CH3]; 
Plot( LineArray(x0BH2, y0BH2 , x1CH3  ,y1CH3 , True , True ), "", colorGrey40 , styleDashed| styleNoLabel);



SetChartBkGradientFill( ParamColor("Top", ColorRGB( 255,255,224 )),
ParamColor("Bottom", ColorRGB( 255,255,224 )),ParamColor("Title",ColorRGB( 255,255,224 )));

Replace the two similar lines with these:

Plot( LineArray( x0AH1, y0AH1, x1BH2  ,y1BH2, True , True ), "", colorGrey40 , styleDashed| styleNoLabel| styleNoRescale);

and:

Plot( LineArray(x0BH2, y0BH2 , x1CH3  ,y1CH3 , True , True ), "", colorGrey40 , styleDashed| styleNoLabel | styleNoRescale);

The chart disappeared

%D9%A2%D9%A0%D9%A1%D9%A8-%D9%A0%D9%A9-%D9%A0%D9%A3%20at%20%D9%A0%D9%A1-%D9%A1%D9%A1-%D9%A3%D9%A7

No, it has not:

Image%201

Thank you very much
:+1:

%D9%A2%D9%A0%D9%A1%D9%A8-%D9%A0%D9%A9-%D9%A0%D9%A3%20at%20%D9%A0%D9%A6-%D9%A0%D9%A0-%D9%A5%D9%A3

:raising_hand_man: