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