Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Convert Indicator To Strategy

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

    Convert Indicator To Strategy

    Hi,
    I was wondering if someone could help me wrap my head around how to access private variables in a indicator to trigger buy and sells in a strategy. Attached is a indicator I want to use to trigger my entrys. Inside the indicator are the variables HighestHi and LowestLow which are private. This indicator also plots lines for fib points so I would also like access to those as well. I have looked at the sampleboolseries example as well as a couple others, but I just can't seem to grasp the OO concept this language uses. I tried building a strategy in the wizard and I can add the indicator, but can not select the variables to set a logical trigger to on what I want. Any thoughts or other examples actually converting an indicator to a strategy would be greatly appreciated.
    Thanks
    Attached Files

    #2
    Widgetman,

    I have written indicators and strategies in the past and there was no way to use the indicators in the strategy, you had to copy and rewrite them for use in the strategy. E.g. the indicators were not available for generic use within the strategy.

    This was a bit of a pain, as if you made a change to the indicator, you had to remember what you had changed and make the same change in the strategy.

    I think that there are some notes on this in the 6.5 help.

    Hope this is of some use.

    Regards,

    Graham.

    Comment


      #3
      Widgetman, there is a reference sample available for exposing private DataSeries that are not plots, which can help get you started with using an indicator in a strategy.
      AustinNinjaTrader Customer Service

      Comment


        #4
        Hello Widgetman,

        You can only access it if it is made public. Though not necessarily plotted.
        A good example is DoubleMA from NT script sharing. It has two private series with corresponding public series, but they are both not plotted.

        But for debugging speed, you should consider plotting it so you actually see on a chart when signal is given. If your primary indicator plots on panel 1, it would be difficult to code signal level that is price level sized so it does not affect the panel1 scaling. So you could use unplotted public data series then use a wrapper indicator that actually plot them on another panel.

        Hope it helps.

        Regards,
        EdwardK.

        Comment


          #5
          Thanks Guys

          Hi,
          Thanks for all the info and help. I ended up making a strategy out of the indicator as suggested by someone here earlier. This seemed to be the least path of resistance for me. Maybe some day I can grasp this concept of OO inheritance, and all the cool stuff it does. In Easy Language all I would have to do would be to comment out the plot lines in an indicator to make it a strategy. I guess I have a lot to learn about C#
          Thanks

          Comment


            #6
            Hello Widgetman,

            Using indicator as the real strategy base is the way to go, because it plots! One need to see what is going on. Strategy does not plot, if it does not do certain thing as one expected, the only thing one can do is print, which is going to be difficult to relate where things happen or does not happen.

            The actual strategy file would then do stuff that indicator cannot do, things related trade, such as entry, target, stop order and management, trade management, time and money management.

            Cheers.

            EdwardK.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X