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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 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
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X