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!
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
NinjaTrader
Creating custom functions
Collapse
X
-
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?Tags: None
-
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"Paul H.NinjaTrader Customer Service
-
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.htmPaul H.NinjaTrader Customer Service
Comment
-
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=75585Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment