Displacement

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Indicator > AddPlot() >

Displacement

Previous page Return to chapter overview Next page

Definition

An offset value that shifts the visually displayed value of an indicator.

 

Property Value

An int value that represents the number of bars ago to offset with.

 

Syntax

Displacement

 

Examples

ns

protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {
        Displacement = 2; // Plots the indicator value from 2 bars ago on the current bar    
        AddPlot(Brushes.Orange, "SMA");
    }
}