Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 aussugardefender, Today, 01:07 AM
    0 responses
    1 view
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    383 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Working...
    X