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

Creating custom functions

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

  • NinjaTrader_PaulH
    replied
    Hello,

    Thanks for your reply.

    Without further information it would be difficult to say. I am assuming this is an indicator that you have created and exported with security discussed earlier in this thread. If you would like to you can send in your exported indicator and I will be glad to review adding it to a strategy. Send to PlatFormSupport[at]NinjaTrader[dot]Com with atten: Paul and link: http://ninjatrader.com/support/forum...ad.php?t=75585

    Leave a comment:


  • dbtrader
    replied
    Paul,

    I'm able to call SMA and other indicators, but not the custom indicator. What reason would cause the custom indicator to be unavailable?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello dbtrader,

    Thanks for your reply.

    To use an indicator with a strategy you would use the method and the parameters.
    Here is an example using the simple moving average indicator SMA

    double smaoutput = SMA(20)[0]; // save current value of 20 period sma
    Print ("Currentbar:" +CurrentBar+" SMA(20) value: " +smaoutput);

    or to use the indicator directly in the string
    Print (("Currentbar:" +CurrentBar+" SMA(20) value: "+SMA(20)[0]);

    If you want to have the strategy also display the indicator, you would use the Add() method http://ninjatrader.com/support/helpGuides/nt7/?add2.htm

    Leave a comment:


  • dbtrader
    replied
    Hi Paul,

    That doesn't quite answer my question. If the user wants to build a NinjaScript strategy based on the indicator how would he do that?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello dbtrader,

    Thanks for your post.

    You would want to export your indicators as assemblies to prevent access to the source code. The process is covered in the helpguide: http://ninjatrader.com/support/helpG...stribution.htm see the section, "Exporting NinjaScript Indicators or Strategies as Assembly"

    Leave a comment:


  • dbtrader
    started a topic Creating custom functions

    Creating custom functions

    I have some custom indicators in NinjaScript. A user wants to be able to use the indicators in a strategy. Is there a way I can create a function he can call from the strategy and distribute this while still keeping the code protected?

Latest Posts

Collapse

Topics Statistics Last Post
Started by psangram, Today, 09:30 AM
1 response
10 views
0 likes
Last Post NinjaTrader_Gaby  
Started by gabberdim, Today, 09:14 AM
3 responses
12 views
0 likes
Last Post NinjaTrader_Gaby  
Started by ZeroKuhl, 05-30-2024, 10:22 AM
3 responses
18 views
0 likes
Last Post NinjaTrader_Jesse  
Started by johnsb1990, Today, 09:34 AM
1 response
7 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by kiss987, 05-16-2018, 02:19 AM
13 responses
2,849 views
0 likes
Last Post NinjaTrader_Jesse  
Working...
X