Announcement
Collapse
No announcement yet.
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 michelz, 02-18-2025, 08:30 AM
|
18 responses
356 views
0 likes
|
Last Post
![]()
by neveral0n3
Today, 10:49 AM
|
||
Started by laketrader, 03-10-2025, 07:20 AM
|
4 responses
32 views
0 likes
|
Last Post
![]()
by laketrader
Today, 04:15 PM
|
||
Started by owensd, 04-21-2024, 11:34 PM
|
19 responses
187 views
0 likes
|
Last Post
![]() |
||
Started by bokorb, Yesterday, 02:45 PM
|
2 responses
22 views
0 likes
|
Last Post
![]()
by bokorb
Today, 11:40 AM
|
||
Started by Schools, Yesterday, 03:32 PM
|
1 response
25 views
0 likes
|
Last Post
![]()
by Schools
Today, 10:06 AM
|
Comment