Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue on using the Regression Channel Indicator to determine the trend of the market.

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

    Issue on using the Regression Channel Indicator to determine the trend of the market.

    Hello, I would like to use the Regression channel indicator to determine the trend in the market, so my strategy opens only long positions when the regression channel indicator (RCI) determines the market is in an uptrend. Likewise, when the RCI is in uptrend the strategy should open only short positions.
    The problem I am having is this: I need to declare a DataSeries variable to collect the RCI slope data, so I use the RCI slope data to determine the market trend in my strategy. I declare the DataSeries as follows:
    public DataSeries mySlopeSeries;
    If I declare mySlopeSeries as public, I cannot save the template; if I declare it as private there is not any issue. I do not understand the reasons for this behaviour. I read the post on serialization believing it to would be the origin of the problem and adopted the suggestions, but it did not help.
    The post I am referring to is this one:

    Please help me out! As an attachment you can find the regression channel indicator that I modified.
    Thank you for all your help, ciao.
    Attached Files
    Last edited by CLDGLR; 10-22-2016, 12:13 PM.

    #2
    Hello,

    Thank you for the post.

    Adding only the public modifier to a DataSeries can cause the outcome you have described, mainly the attributes that would prevent this are missing.

    In the script you already have a public expose series MySlopeSeries, the backing field has been made public which you noted is causing a problem:

    public DataSeries mySlopeSeries;
    What is the end result you are trying to achieve by changing the backing field to public?
    Is the data series intended to be exposed for other NinjaScript items to use, or are you simply trying to store data in the indicator?


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello
      My plan is to develop my own strategy using the RCI’ s mySlopeSeries as an indication for the market trend. So mySlopeSeries is going to be used in my new ninjascript strategy. This is the reason I need it to be public.
      What are exactly the attributes that would allow the template to be saved? In what method of the RCI’s program do I need to add them on?
      Thank you for your help!

      Comment


        #4
        Hello CLDGLR,

        Its fine to make a data series public to be used in another script.

        The MACD indicator is great example of this (Tools -> Edit NinjaScript -> Indicator... -> MACD -> OK). This has 3 plots, the MACD or Default plot, the Avg plot, and the Diff plot. The script defines 3 public data series in the Properties region that returns the Values[plot index] as a public data series to be accessed from another script.

        You will not want the data of the data series being saved in the template so all data series must have the [XmlIgnore()] attribute to prevent NinjaTrader from attempting to save these.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        7 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        7 views
        0 likes
        Last Post quantismo  
        Started by AttiM, 02-14-2024, 05:20 PM
        8 responses
        168 views
        0 likes
        Last Post jeronymite  
        Started by cre8able, Today, 04:22 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X