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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X