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

Parabolic Sar with Day Bar

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

    Parabolic Sar with Day Bar

    Hello,

    I have a strategy which works with minute bars, but I also need the value of the previous day parabolic SAR and VIX calculated with day Bars

    How I could charge this parametres?

    I obtain the VIX value from a data provider, but I don`t know how to charge it
    Last edited by etruria; 07-14-2018, 10:32 AM.

    #2
    Hello etruria,

    Thank you for your note.

    I’ve attached a sample which will add a secondary data series with a period of day, which is then passed to the Parabolic Sar method and prints to the output window the value on the current bar. For the previous days value you would change,

    Code:
    ParabolicSAR(BarsArray[1], 0.02, 0.2, 0.02)[0];
    To,

    Code:
    ParabolicSAR(BarsArray[1], 0.02, 0.2, 0.02)[B][1];[/B]
    For 1 bar ago.

    Parabllic Sar section of our helpguide.


    For the value of the VIX, you would want to add the Vix data series to your strategy,

    Code:
    Add(^VIX, PeriodType.Day,1);
    And then pass BarsArray[2] to the Parabolic Sar method just like in the example, but BarsArray[2] rather than BarsArray[1].

    Adding another series to the attached script would require you to also add another current bar check, which might look like,

    Code:
    if(CurrentBars[2] < 10) return;
    See the link below on CurrentBar checks,


    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      So, I supose that the name with I call the vix would be

      CloseVix = VIX(BarsArray[2])[1]

      Thanks for your help

      Comment


        #4
        Hello, I have tried the code you have told me for the VIX and I can´t compile the strategy because the program said me that it doesn´t recognize the following character ^

        Thanks for your help

        Comment


          #5
          Hello etruria,

          Use quotes for the symbol name.

          Add("^VIX", PeriodType.Day,1);

          See Add section of our helpguide,


          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          31 responses
          816 views
          1 like
          Last Post NinjaTrader_Adrian  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          5 responses
          14 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by swestendorf, Today, 11:14 AM
          2 responses
          6 views
          0 likes
          Last Post NinjaTrader_Kimberly  
          Started by Mupulen, Today, 11:26 AM
          0 responses
          6 views
          0 likes
          Last Post Mupulen
          by Mupulen
           
          Started by Sparkyboy, Today, 10:57 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X