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

data series

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

    data series

    I am trying to get an Arrow to print when making the ehlersinewave indicator a data series. I can get the Arrows to print when I call it on the current bar, i.e. EhlerSine_data[0] > 0 but when I change the code to pick up the prior bar EhlerSine_data[1] > 0 I do not get any arrows. I am stumped on this because I have done similar code just like this with no problem. Any thoughts?


    publicclass TriggerSine : Indicator
    {
    #region Variables

    private DataSeries EhlerSine_data;

    #endregion

    ///</summary>
    protectedoverridevoid Initialize()

    EhlerSine_data = new DataSeries(this);

    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    if (CurrentBar < 10)
    return;

    // Here I am loading the data in the new custom data series


    EhlerSine_data.Set(EhlersSineWave.LeadSine[0]);

    ///// condition statement /////

    if ( EhlerSine_data[0] > 0 )
    {DrawArrowUp("MyArrowUp1"+CurrentBar, 0, Low[0] - TickSize, Color.Green);}

    }

    #2
    Print the values of your DataSeries as well as your indicator.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 12:14 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by aprilfool, 12-03-2022, 03:01 PM
    2 responses
    326 views
    0 likes
    Last Post BottomShark77  
    Started by AnnBarnes, Today, 12:17 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Lopat, 03-05-2023, 01:19 PM
    4 responses
    167 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by giulyko00, Today, 12:03 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X