Basic price chart parameters

I created a new line indicator with a param variable. It now seems that the parameter is included in the basic price params.
Having not noticed it before, is it a parameter for the price chart or how do I remove it? Even if I delete the plot lines indicator it remains.




No, it is not in original Price AFL.
You have added it.

No, one knows your full code. So why do you post just picture?

Every chart runs by AFL formula. So you have to remove line with function Param("confirm days",...) from your AFL if you do not need/want it anymore and if it is "zombie code" line.

Click on the chart then press shortcut CTRL+E. Then remove that line (if other code is not dependent on that variable - you have to check yourself what you have added there). After removing it click Apply button but not Save button.

Or simpler (and if your chart is just price chart).... close chart pane and go to "Basic Charts" folder of "Charts" window and apply "Price" again.

1 Like

Thanks for the interest fxshrat.

What was confusing me was that I had closed all other indicators except the price one and the parameter was still there.
I posted the 2 pictures to illustrate that the parameter was still there after all other indicators had been closed.
I followed your CTRL+E advice, deleted several occurrences of the offending parameter, clicked apply. It now appears to be correctly no longer there. How it got into the price chart I don't have a clue as I certainly did not do it on purpose. Obviously, I did something but what, I don't know.

I had closed and reopened the price chart but the parameter was still showing.


Click reset all in Param Window


He has deleted the "plot lines" section already via right-clicking title and choosing "Delete plot lines" there.
So that one refreshed the chart already and the other param occurrence was still there in Param window. So the Param still existed in that AFL file.

So "Refresh All" does not change anything in that case. It will not remove it.

He had to remove it from AFL (if he does not wanted that param line to be in there anymore in that AFL and if he wanted to keep that pane) as suggested above. And then clicking APPLY button saves and refreshes (and removed obsolete Param) already.

1 Like

Having sorted out the parameter problem (many thanks to #fxshrat) I now have a working line plot.
For me, it was a useful exercise in understanding a zig-zag type plot by using the selected bar as the endpoint of the plot.

In case anyone is interested I have included the 2 codes (1 include member and the indicator code).
I am aware that other code exists (e.g. zig) but I wanted to see the effect as each bar is clicked.


The plot line indicator code :

_TRACE( "!CLEAR!" );

#include_once <>;

confirmBars = Param("confirm days", 3, 1, 10, 1 );
showHistory = Paramtoggle("show history", "No|Yes", 0 );

allLines = linePlotter( SelectedValue( bi ), confirmBars, showHistory );

Plot( allLines, "all lines", colorWhite, styleLine, Null, Null, 0 );

and the include code "lineplotter"

//global lineStartBi;
//global lineEndBi;
//global startClose;
//global endClose;
//global confirmLow;
//global confirmHigh;
//global isTrough;
//global isPeak;
//global troughBi;
//global paekBi;

//global confirmBars;
//global confirmedBi;

global inUpSwing;
global inDownSwing;

lineStartBi = lineEndBi = startClose = endClose = 0;

bi = barIndex();

function linePlotter( lineEndBi, confirmBars, showHistory )

    showHistory = nz( showHistory, false );

    outputLine = Null;
    //_TRACE( "Selected Bi " + selectedBi );
    //_TRACE( "confirmedBi " + confirmedBi );
    //_TRACE( "lineEndBi " + lineEndBi );

    isFirstLine = True;

    while( lineEndBi > 0 )
        if( isFirstLine )
            isFirstLine = false;
            confirmedBi = lineEndBi - confirmBars;

            confirmLow = llv( Close, confirmBars );
            confirmHigh = hhv( Close, confirmBars );

            isTrough = IIf( bi <= confirmedBi
                            AND Close < Ref( confirmLow, confirmBars )
                            AND Close <= Ref( Close, -1 ), True, False );

            isPeak = IIf( bi <= confirmedBi
                          AND Close > Ref( confirmHigh, confirmBars )
                          AND Close >= Ref( confirmHigh, BarsSince( confirmLow ) * -1 ), True, False );

            isPeak = ExRem( isPeak, isTrough );
            isTrough = ExRem( isTrough, isPeak );
            PlotShapes(ispeak * shapeDownArrow, colorRose, 0,  High );
            PlotShapes(isTrough * shapeupArrow, colorRose, 0,  low );

        peakBi = ValueWhen( isPeak AND bi < lineEndBi , bi );
        troughBi = ValueWhen( isTrough AND bi < lineEndBi, bi );

        sincePeak = bi - peakBi;
        sinceTrough = bi - troughBi;

        inDownSwing = IIf( sincePeak < sinceTrough, True, False );
        inUpSwing = IIf( sinceTrough < sincePeak, True, False );

        lineStartBi = IIf( inDownSwing, peakBi, troughBi );        
        lineStartBi = Nz( lineStartBi[lineEndBi] );
        startClose = Close[lineStartBi];

        lowestSincePeak = LowestSince( bi == peakBi, Close );
        highestSinceTrough = highestsince( bi == troughBi, Close );
        endClose = IIf( inDownSwing, lowestSincePeak, highestSinceTrough );
        endClose = endClose[lineEndBi];

        Line = LineArray( lineStartBi, startClose, lineEndBi, endClose );
        outputLine = IIf( IsNull( line ), outputLine, line );

        if( NOT showHistory )
            lineEndBi = -1;
            lineEndBi = Nz( lineStartBi, -1 );


    return outputline;

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.