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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        36 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        287 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        288 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        134 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        95 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X