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
Start Behaviour is a pain, why?
Collapse
X
-
Hello Skifree
You can do that, you would need to program your strategy to enter trades only in realtime. When you apply a strategy will backtest over the historical data before entering into realtime. The default start behavior is to wait for your strategy to finish any positions it entered before starting to work in realtime.JesseNinjaTrader Customer Service
-
Hello Skifree,
Yes, when you backtest a strategy that's the exact same process that happens when you apply a strategy to a chart. It places historical trades during the backtest on the chart or in the strategy analyzer. If you wanted to you could make a user input to toggle historical trading so that you could still backtest it.JesseNinjaTrader Customer Service
Comment
-
Hello Skifree,
Your strategies logic would need to do that. Wait until flat is waiting for your strategies exit logic to happen so it becomes flat, that is a virtual trade because its closing a historical position. Real trades would be entered once the strategy actually starts running after the historical position is closed.
To have it start right away you would either have to not make historical positions or have logic which exits the trade so its flat when it enters realtime.JesseNinjaTrader Customer Service
Comment
-
Thanks for the help. For others: I use a custom input bool "isBacktest" to allow me more flexibility here. This seems to work so that I can enter flat without losing money going flat.
Code:protected override void OnBarUpdate() { if (isBacktest == false && State == State.Historical) { return; }
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Balage0922, Today, 07:38 AM
|
0 responses
1 view
0 likes
|
Last Post
by Balage0922
Today, 07:38 AM
|
||
Started by JoMoon2024, Today, 06:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by JoMoon2024
Today, 06:56 AM
|
||
Started by Haiasi, 04-25-2024, 06:53 PM
|
2 responses
19 views
0 likes
|
Last Post
by Massinisa
Today, 05:32 AM
|
||
Started by Creamers, Today, 05:32 AM
|
0 responses
6 views
0 likes
|
Last Post
by Creamers
Today, 05:32 AM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
12 responses
1,786 views
0 likes
|
Last Post
by Leafcutter
Today, 05:30 AM
|
Comment