Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator as function

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

    Indicator as function

    Hello all.

    I need to build an Indicator to be then recalled into a strategy as a function.
    The example is like a SMA that could be recalled into any indicator or strategy, simply writing SMA(10)........

    Is there any peculiarity to do this or I just need to build my indicator with inputs and then recall it anywhere?

    Thanks.

    Max

    #2
    Just build the indicator and you can call it anywhere.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      But I cannot use Position information in an indicator as Position.MarketPosition?

      My trouble is: how can I build an indicator into a strategy and then show this indicator on the chart in order to have both the system and the indicator?

      Let's say I want to have an indicator on chart that shows my stop on a long position as the lowest low of the last 3 bars. So it must be activated only if have a long position. How can I do this?
      Thanks
      Last edited by MAX; 12-01-2007, 02:50 PM.

      Comment


        #4
        You are correct. You cannot use Position.MarketPosition in an indicator.

        Instead of using an indicator then you can probably just code it into your strategy through the use of various Draw methods. You can use DrawLine() to just draw a line at the price you want when your conditions are met.



        If you do want to use an indicator then what you would need to do is just program the same logic you have in your strategy into the indicator. Then, in the indicator, plot the low when the long entry condition is met. Basically mirror the strategy, but instead of entering a trade just plot the stop value.
        Last edited by NinjaTrader_JoshP; 12-01-2007, 03:35 PM.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X