Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modify the Data Series if...

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

    Modify the Data Series if...

    Been reading past posts trying to find if it is possible to change the data series based on a variable before the script begins to run for the session. For example

    I use a range chart and change the data series from 3 Range, to 4 Range, to 5 Range based on the VIX, which I enter manually each day. So, if I use a private int VIX and manually enter 12 or less, I want the Range to 3. Between 13 and 18, Range is 4, 18 to 23 Range is 5...any VIX 24 and higher the strategy will not trade.

    I have the DO NOT TRADE worked out because it does not matter what the previous Data Range was, the strategy will not need to adjust the current data series, it just does not take trades until I enter a VIX less than 24. Currently I am adjusting the Data Series manually. In sum, I want to only enter the VIX. So, I am looking for something like:

    Code:
    If (Vix< 12)
    DataSeries=Range.3  (whatever this would be)
    Else if (Vix>12 & Vix <19)
    DataSeries=Range.4   (whatever this would be)
    Else if (Vix>18 & Vix<25)
    DataSeries=Range.5  (whatever this would be)
    Else if (Vix> 24)
    return;
    Can someone point me in the right direction?

    Thanks

    #2
    Hello Sarasotavince,

    Thank you for your note.

    What will this DataSeries be holding and used for exactly?

    Are you trying to sync the DataSeries to a specific Range for this Vix variable?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Maybe I am using the wrong terms...I trade from a range chart. It's the only data series I use for this strategy... So, for example, under Period via the Data Series icon on my chart:

      Price based on: Last
      Type: Range
      Value: 4

      When I manually enter the VIX, I want the Value to be either 3,4, or 5 based on my first post... I don't want to manually change the Data Series Range Value because I could make a mistake..or forget to check it...but when I enter the VIX, that would handle it...I am hoping.

      I hope this makes it more clear...Thanks in advance for your assistance.

      Comment


        #4
        Sarasotavince,

        I don't quite follow along with your posts

        Are you trying to set the Charts Bar type value via script?

        You said that this VIX is an int value. These DataSeries that you are trying to set the different Range values. What exactly are these DataSeries for?

        Do you have an example of what you are trying to do?

        Could you share a sample of your code for a better view?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Let's start again...

          I trade from RANGE data... this is the only data series... So, I use a range chart to plot my indicators and from which to run my strategy.

          In theory, the value of the range bar can be any integer...I go back and forth from values of 3 range bars, 4 range bars, and 5 range bars depending on the Volatility Index (VIX). If the VIX is higher, in my opinion, over 20 lets say for this example, I use longer bars...a value of 5 or even 6... If the VIX is lower, maybe 11 or 12, I use shorter bars with a value of 3.

          One of my variables is:
          Code:
          private int vix =0;
          I enter the vix value at the beginning of each trading session as a variable. So, what I want to happen is the range bar value be determined by the value of the vix, which I enter as a variable. I have posted a screen shot of where I enter the vix...

          Not sure posting code would be any different than the hypothetical code in post #1

          Hope this helps explain my need for code to manage the range value setting on my chart/strategy.
          Attached Files

          Comment


            #6
            Hello Sarasotavince,

            Thank you for the explanation.

            You would not be able to set the primary data series through the script. You can use your method for when you want to Add() an additional background data series but would not affect the primary bars.
            Cal H.NinjaTrader Customer Service

            Comment


              #7

              Maybe something for NT 8 ????

              Comment


                #8
                Sarasotavince,

                I will forward your vote to Development for this feature as it is already on their list for possible enhancements.

                Let me know if I can be of further assistance.
                Cal H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                48 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X