I built an indicator, but I want to copy and paste the entire script into a strategy instead of adding the indicator as a private variable in the public class scope of the strategy. Is this possible?
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
Paste indictor script in Strategy
Collapse
X
-
Paste indictor script in Strategy
Good morning,
I built an indicator, but I want to copy and paste the entire script into a strategy instead of adding the indicator as a private variable in the public class scope of the strategy. Is this possible?Tags: None
-
AdeptistJune I do not think you really want to copy your code from an indicator to a strategy what you want to do is leverage your indicator in a strategy they will get out of sync quickly
Ninja Documentation
search AddChartIndicator()
Take the case of having an indicator with a name of IndicatorName
Create a reference to it
indicator named: MyIndicator
strategy named: MyStrategy
Under Public Class MyClass
private IndicatorNameMyIndicator;
under else if (State == State.DataLoaded)
MyIndicator = InicatorName(Period,StopTicks,Risk_Planned);
MyIndicator.Panel=2;
AddChartIndicator(MyIndicator);
In onBarUpdate
MyIndicator.Monitored_item[0]
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
41 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
1 response
11 views
0 likes
|
Last Post
by bltdavid
Today, 02:44 PM
|
||
Started by port119, Today, 02:43 PM
|
0 responses
7 views
0 likes
|
Last Post
by port119
Today, 02:43 PM
|
||
Started by Philippe56140, Today, 02:35 PM
|
0 responses
7 views
0 likes
|
Last Post Today, 02:35 PM | ||
Started by 00nevest, Today, 02:27 PM
|
0 responses
7 views
0 likes
|
Last Post
by 00nevest
Today, 02:27 PM
|
Comment