Hi,
First the chart :
now the code --
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
//WORK IN PROGRESS
_SECTION_BEGIN("WAVES");
nbar=Param("N Pivot Bars",2,2,21,1);
pk=H>Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar)>=L;
x = BarIndex();
fvb = FirstVisibleValue( x );
lvb = LastVisibleValue( x );
plotarrows = ParamToggle("PLOT ARROWS","NO|YES",0);
plotvalue = ParamToggle( "VALUE", "NO|YES", 0);
R =lvb-fvb;
Hhb = HighestVisibleValue( H ) ;
Llb= LowestVisibleValue( L );
HhL = Hhb+20;
LlL =Llb-20;
if(plotarrows)
{
PlotShapes(shapedownarrow*pk,colorRed,0,HhL);
PlotShapes(shapeuparrow*tr,colorgreen,0,LlL-20);
}
//Value of pivots and range of fall OR rise
Rise = ValueWhen(pk,H,1) - ValueWhen(tr,L,1) ;
Fall = ValueWhen(tr,L,1) - ValueWhen(pk,H,1) ;
for( i = 0; i < lvb; i++ )
if( Plotvalue )
{
if( pk[i] ) PlotText( "" + H[ i ], i-2, HhL+75, colorDarkGreen);
if( tr[i] ) PlotText( "" + L[ i ], i-2, LlL-100, colorDarkRed );
if( pk[i] ) PlotText( "" + Rise[ i ], i-2, HhL+55, colorGreen);
if( tr[i] ) PlotText( "" + Fall[ i ], i-2, LlL-80, colorRed );
}
_SECTION_END();
What I would kike to achieve is mentioned on the chart , a small explanation here--
Trying to mark 2 bar fractal pivots with arrows, plot the value of the pivot and the run - rise or fall in that swing on the chart.
The calculations for the above are done and the plot is based on Hhb = HighestVisibleValue( H ) ;
Llb= LowestVisibleValue( L ); lines - 22 to 27 of the code.
I would like to do the plots at set "pixel levels".
No attempt to do this is shown as I do not know how to do it.
Much appreciate any help