Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

WeisWave Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WeisWave Script

    Hi, I am trying to get the WeisWave Indicator. Which is, if not wrong, mainly the sum of volumes if prices go up and the sum of volumes if prices go lower. Something like the VolUpDown Indicator, but instead of gettin the volume of a bar, it accumulates as prices goes up, once it changes to lower prices, volumes reset to accumulate on its way down.

    I try a script (attached) but I still don't get. I copy the SUM code, as doing it on my own didn't worked.

    IsSuspendedWhileInactive = true;
    BarsToLookBack = 1;
    AddPlot(new Stroke(Brushes.LimeGreen, 2), PlotStyle.Bar, "VolUp");
    AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.Bar, "VolDown");
    AddLine(Brushes.DarkGray, 0, NinjaTrader.Custom.Resource.NinjaScriptIndicatorZe roLine);
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBar < BarsToLookBack) return;



    if (Close[0] > Close[BarsToLookBack])
    {
    VolDown.Reset();
    VolUp[0] = Value[0] = Volume[0] + (CurrentBar > 0 ? Value[1] : 0) - (CurrentBar < BarsToLookBack ? Volume[BarsToLookBack] : 0);
    }

    else if (Close[0] < Close[BarsToLookBack])
    {
    VolUp.Reset();
    VolDown[0] = Value[0] = Volume[0] - (CurrentBar < 0 ? Value[1] : 0) + (CurrentBar > BarsToLookBack ? Volume[BarsToLookBack] : 0);
    }

    }

    #2
    Hello adrian91,

    Welcome to the NinjaTrader forums!

    I'm not able to debug your code or assist with your custom logic, and this thread will remain for any community members that would like to do this on your behalf as a convenience to you.

    That said, you mentioned 'doing it on my own didn't worked'.

    What specifically is not working?

    Are you getting an error?

    Is the value not what you expect when comparing to a manual calculation?

    Are you using prints to understand the behavior? If so, may be have the output from the debugging prints?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X