Example from today:
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
Target and stop not triggering?
Collapse
X
-
Target and stop not triggering?
Hello, I've seen a few other posts with this problem but still having some issues. My targets and stops are working/linking with back testing in the strategy analyzer but when I do it live it doesn't send them. What am I doing incorrectly here? My guess is it's something to do with the IsSimulatedStop/IsMarketIfTouched parameters but not exactly sure. Any help would be greatly appreciated!
Example from today:Tags: None
-
Hello gupagoer,
Thank you for your post.
Please send us the Print output of the order object in OnOrderUpdate() so we may investigate this further. Also, please send us the full output from Prints and TraceOrders saved as a text file.
To save the Prints and TraceOrders from the NinjaScript Output window as a text file, right-click in the NinjaScript Output window and select 'Save as'.
See the help guide documentation below for more information.
OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm
TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm
Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
https://ninjatrader.com/support/foru...121#post791121
I look forward to assisting further.Brandon H.NinjaTrader Customer Service
-
Hello gupagoer,
Thank you for that information.
Are you able to reproduce the behavior using the Playback Connection with Market Replay data?
If so, please send us the Prints output in the NinjaScript Output window when reproducing the behavior with the Playback Connection so we may investigate further.
See the help guide documentation below for more information about using Playback with Market Replay.
Playback - https://ninjatrader.com/support/helpGuides/nt8/playback_connection.htm
I look forward to your reply.Brandon H.NinjaTrader Customer Service
Comment
-
Sorry I didn't attach these last time.
And I don't think I can use it on Market Replay because it has to load 10 market days of past data prior to the start date.
Comment
-
Hello gupagoer,
Thank you for your note.
The strategy should be able to be tested using the Playback connection with Market Replay data to simulate the strategy running realtime.
Prior to using the Playback connection, you would need to ensure that you have enough days of Market Replay data downloaded to use with the Playback connection. For example, if you are testing your strategy for 3 days worth of data and the strategy requires 10 previous days of data, you would need to download 13 days worth of data to use with Playback.
Before downloading Market Replay data please note:- Enable market recording for playback must be disabled from the Market Data category of the Options menu before downloading replay data.
- Downloading Market Replay data is NOT available when connected to the Playback connection. You must disconnect from the Playback connection prior to downloading.
- Select the Tools menu in the Control Center, select the menu item Historical Data and select "Load" tab. Here the section "Get Market Replay data" can be expanded.
- Select the instrument and date of the desired replay data and press the OK button to begin the download.
More information about downloading Market Replay data to use with Playback may be found in the NinjaTrader Help Guide link below.
https://ninjatrader.com/support/help...jaTraderServer
To connect to Market Replay data:- Left mouse click on the Connections menu in the Control Center
- Select the menu item Playback Connection menu item
More information about how to work with Market Replay data may be found in the NinjaTrader Help Guide link below.
https://ninjatrader.com/support/help...WithReplayData
Please let us know if we may be of further assistance.Brandon H.NinjaTrader Customer Service
Comment
-
I don't have "Enable market recording for playback" enabled. And I'm not connected to playback and am getting the error "There is no market replay data available for this instrument date" for every Instrument I've tried on a market day.
I also dont have access to enough tick data to use the historical method either.
Comment
-
Hello gupagoer,
Thank you for your note.
What are the dates of the Market Replay data you are trying to download?
What instruments are you trying to download Market Replay data for?
Please note Market Replay data does not come from your data provider, it is provided by NinjaTrader. Market replay is available for the most popular futures and forex instruments for the past 90 days.
That said, are you able to download data for a range of dates for say the ES 06-21 instrument within the past 90 days to test your strategy with?
I look forward to your reply.
Brandon H.NinjaTrader Customer Service
Comment
-
Here's the market replay for two days. The orders were behaving as expected.
Comment
-
Hello gupagoer,
Thank you for that information.
What time zone are you using?
Who is your broker?
According to your Backtesting print output and Playback print output, it seems that the stop and target orders are working as expected.
However, I do not see print outputs for OnOrderUpdate() as requested in my initial reply.
"Please send us the Print output of the order object in OnOrderUpdate() so we may investigate this further."
Please add prints to OnOrderUpdate() that print out the order object and comment out all other prints in your script temporarily.
After adding the requested prints to the script, please make a copy of the strategy. Below is a link to a video that demonstrates making a copy of a script. Once the copy is created, please modify the copy so that prints appear in Output window 2. See the PrintTo help guide documentation below for how to accomplish this.
Making a Copy of a NinjaScript - https://www.youtube.com/watch?v=BA0W...utu.be&t=8m15s
PrintTo - https://ninjatrader.com/support/help...t8/printto.htm
After doing the above, run the original script Live and the copy script on the Sim101 account. Ensure that both strategies are enabled and run at the same time; one Live, and one on the Sim account. After running the scripts, send us the full output from Prints and TraceOrders saved as a text file for both Output windows.
Let us know if we may assist further.Last edited by NinjaTrader_BrandonH; 04-27-2021, 09:02 AM.Brandon H.NinjaTrader Customer Service
Comment
-
" However, I do not see print outputs for OnOrderUpdate() as requested in my initial reply.
"Please send us the Print output of the order object in OnOrderUpdate() so we may investigate this further." "
What? I did print out the orders? Did you read the txt file? I've highlighted those parts so you can identify them easier.
Sorry I would like to ensure I'm doing this correctly before moving on to the next part.
Comment
-
Hello gupagoer,
Thank you for your note.
I do see that you are printing the order object in OnOrderUpdate(). Please comment out all other prints in your script temporarily and follow the directions in my previous post. This will allow us to compare the orders placed by your strategy when it is running Live and when it is running on a Sim account. By doing so we would be able to see where the stops and targets are submitted without issue on the Sim account and compare those to the orders placed on the Live account.
After adding the requested prints to the script, please make a copy of the strategy. Below is a link to a video that demonstrates making a copy of a script. Once the copy is created, please modify the copy so that prints appear in Output window 2. See the PrintTo help guide documentation below for how to accomplish this.
Making a Copy of a NinjaScript - https://www.youtube.com/watch?v=BA0W...utu.be&t=8m15s
PrintTo - https://ninjatrader.com/support/help...t8/printto.htm
After doing the above, run the original script Live and the copy script on the Sim101 account. Ensure that both strategies are enabled and run at the same time; one Live, and one on the Sim account. After running the scripts, send us the full output from Prints and TraceOrders saved as a text file for both Output windows.
I look forward to assisting further.Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
Comment