Although the no. of arguments are paired co-ordinates, unable to find the cause of the error.
Was trying to plot a tilted triangle (pointer) around the close using GfxPolygon
which would glide automatically as price moves, but, got the error. Works fine when pxY is assigned as a param and slided manually.
SetChartBkColor( colorAqua );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
pxchartbottom = Status("pxchartbottom");
pxchartheight = Status("pxchartheight");
value = LastValue( C );
//pxY = Param( "pxY", 0, 0, 2500, 1 );
pxY = pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) ); //Y co-ordinate to pixel
GfxSetOverlayMode( 0 );
GfxSelectPen( colorBlack );
GfxSelectSolidBrush( colorBlue );
//Shape of a tilted triangle. No error if pxY is assigned as a param and slided manually.
GfxPolygon( 1500, pxY, 1500+20, pxY-20, 1500+20, pxY+20 );
Plot( C, "C", colorBlack, styleCandle|styleOwnScale );
Interestingly, same code finds no error when a GfxRectangle
is used.
SetChartBkColor( colorAqua );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
pxchartbottom = Status("pxchartbottom");
pxchartheight = Status("pxchartheight");
value = LastValue( C );
//pxY = Param( "pxY", 0, 0, 2500, 1 );
pxY = pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) ); //Y co-ordinate to pixel
GfxSetOverlayMode( 0 );
GfxSelectPen( colorBlack );
GfxSelectSolidBrush( colorBlue );
//No error!
GfxRectangle( 1500, pxY-5, 1500+35, pxY+5 );
Plot( C, "C", colorBlack, styleCandle|styleOwnScale|styleNoLabel );
Also, no error when GfxMoveTo, GfxLineTo is used. Is there a way to fill the inner fence with color?
SetChartBkColor( colorAqua );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
pxchartbottom = Status("pxchartbottom");
pxchartheight = Status("pxchartheight");
value = LastValue( C );
//pxY = Param( "pxY", 0, 0, 2500, 1 );
pxY = pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) ); //Y co-ordinate to pixel
GfxSetOverlayMode( 0 );
GfxSelectPen( colorBlack, 2 );
//No error!
//Is there a way to color fill the inner fence?
GfxMoveTo( 1500, pxY );
GfxLineTo( 1500+20, pxY-20 );
GfxMoveTo( 1500+20, pxY-20 );
GfxLineTo( 1500+20, pxY+20 );
GfxMoveTo( 1500+20, pxY+20 );
GfxLineTo( 1500, pxY );
Plot( C, "C", colorBlack, styleCandle|styleOwnScale|styleNoLabel );
Thanks for your time!