Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use of function

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

    Use of function

    Hi,
    I am new to Ninja trader, and try to adapt my indicator from tradestation easy language to ninja script.
    I would like to create a function lets say example
    such as example[reference] = SMA(Close,Lenght)[reference]
    that could be called into another indicator as for an example

    if(CrossAbove(example[0],0.25))
    indicator = 1;

    But this has not been working for me, any thoughts anyone.
    Regards

    #2
    letaxi, welcome to our forums here - there would be no need to create subfunction in NinjaScript, any indicator would already per default expose a callable method - like the SMA(Close, Period)[bars ago] you cited.

    Please be aware of the contents of this tip though - http://www.ninjatrader.com/support/f...ead.php?t=3170
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by georgeinharmony, Today, 12:06 AM
    2 responses
    12 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by Prisalice, Yesterday, 07:07 AM
    2 responses
    16 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Futurestrader00, Yesterday, 12:04 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Blairski, Yesterday, 11:26 PM
    0 responses
    9 views
    0 likes
    Last Post Blairski  
    Started by aligator, Yesterday, 02:38 PM
    0 responses
    10 views
    0 likes
    Last Post aligator  
    Working...
    X