• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:
    http://ninjatrader.com/support/forum...ad.php?t=51299
    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 jrobin747, Today, 02:37 PM
        2 responses
        12 views
        0 likes
        Last Post bltdavid  
        Started by Gav_G, Today, 01:23 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by webus, Today, 01:05 PM
        2 responses
        23 views
        0 likes
        Last Post webus
        by webus
         
        Started by Wick Wrangler, Today, 12:42 AM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by pman777, 04-15-2020, 05:09 AM
        5 responses
        50 views
        0 likes
        Last Post NinjaTrader_Kate  
        Working...
        X