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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    36 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    19 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X