Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 TradeSaber, Today, 07:18 AM
        0 responses
        4 views
        0 likes
        Last Post TradeSaber  
        Started by PaulMohn, Today, 05:00 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        17 views
        0 likes
        Last Post SantoshXX  
        Working...
        X