Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Understanding start behavior
Collapse
X
-
Chelsea:
I inserted your code into the strategy. I don't necessarily want to prevent the strategy from processing historical data, but I do want to be able to apply the script and begin executing trades immediately, without waiting for the virtual order to close the historical position, when I see signs from price action that the market has temporarily converted into a sideways market. Can you tell me if I inserted the script properly? The strategy appear to still function, but I don't know if it will accurately begin generating signals on live data immediately.
OneMinSwingIndScalpCloseOnRevC345StartNow.zip
Thanks-
Rick
-
I have been trying to study C#, but since this will be by first time unlocking code, where should I place this? And I assume I begin at the "if" statement?
Leave a comment:
-
Hello Bionian,
The strategy will process historical data before real-time data.
Historical orders will appear on the chart.
https://ninjatrader.com/support/foru...442#post782442
With Wait until flat, if the strategy calculates a historical position open, it will wait until a virtual order closes the historical position before placing any real-time orders.
Once the strategy has become flat or crossed through flat, the strategy name will become green indicating the strategy is now sending real-time orders.
https://ninjatrader.com/support/foru...541#post811541
To prevent a strategy from processing any historical data use:
if (State == State.Historical)
return;
To exit a position on the last historical bar use:
if (State == State.Historical && CurrentBar == Count - 2)
{
if (Position.MarketPosition == MarketPosition.Long)
ExitLong();
if (Position.MarketPosition == MarketPosition.Short)
ExitShort();
}
- Likes 1
Leave a comment:
-
Understanding start behavior
Please help me to understand Start Behavior for a strategy. I currently have the behavior set to "Wait until flat, synchronize account". But I just activated a strategy, and on the chart it shows that there is an active short on the chart. I believe currently the strategy will wait until that trade finishes, and then it will start initiating trades once the strategy is flat. How can I get the strategy to activate a trade on the NEXT signal, without having it activate immediately based on the last signal?Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, 03-13-2026, 05:17 AM
|
0 responses
86 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
151 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
79 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
52 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
59 views
0 likes
|
Last Post
|

Leave a comment: