Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Default vs NinjaScript Category in Log
Collapse
X
-
Default vs NinjaScript Category in Log
I am running a strategy live and it entered a trade in between bars (I am using onBarClose) and this trade did not occur in the backtest, when looking at the execution of this trade in the log, it is categorized as "Default" with message "Ninjascript strategy EMACrossOver submitting order". I noticed that for other entries that occurred correctly (same execution appears live and in backtest) the message is the same, but it is categorized as "Ninjascript" in the log. Why is this?Tags: None
-
Hello samish18,
Thank you for your post.
Generally, "Default" would be from the core and "NinjaScript" would be something specific about a NinjaScript. In my testing I am seeing that the very first submission after enabling is categorized as Default and the rest are labeled as NinjaScript - this would be incorrect. If you would like I can submit a report on this.
Regarding a difference between your live performance, as has been discussed on your previous posts, live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics. Instead these are filled based on logical rules from processing historical data.- When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data.
- This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known
- Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.
EnterLong(int barsInProgressIndex, int quantity, string signalName)
What is the BarsInProgress index you are supplying to the order methods?
During what BarsInProgress is the order submitted?
If you have implemented intrabar granularity and are still seeing a discrepancy, please provide the output from debugging to understand what is causing the differences.
Write the price data and condition values to a text file, write the order.ToString() and execution.ToString() in a text file.
Run the strategy again in real-time and backtest.
Below is a link to a support article that provides instructions and an example script with sample code.
- When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data.
-
Yes, please submit a report on it. I am running the strategy using onBarClose, and am never entering intrabar. I noticed with other strategies, the first submission is still categorized as "NinjaScript", it is only the erroneous order that happened intrabar and on a day when the strategy took no other in backtest that was cateogorized as "Default". This leads me to believe that the submission under the "Default" category was faulty and I would like to avoid this
Comment
-
Hello samish18,
I will submit a report on the Log message displaying as "Default" when it should be "NinjaScript".
However, I cannot claim in the report that the orders labeled "Default" are erroneous without evidence. We would need output from debugging that illustrates this.
Regarding intrabar granularity, this is not for entering intrabar. This is for accurate order fills, and is still necessary when using OnBarClose.Last edited by NinjaTrader_Gaby; 12-11-2024, 02:01 PM.
Comment
-
Hello samish18,
Thus far you haven't provided any evidence that suggests that the incorrect labeling is also an erroneous entry (an entry your strategy wasn't supposed to take).
While I can see that the first submission is labeled as "Default" in the Log, from my testing there is nothing to suggest that this is tied to the strategy's logic / the strategy wouldn't have taken this order.
If you're suggesting the label bug and this order submission are related, you would need to provide debugging output showing clearly showing that the conditions in your script shouldn't have allowed for this entry to be taken. Otherwise, the only thing I can note in the report is that the label is simply wrong (not that the entries are wrong).Last edited by NinjaTrader_Gaby; 12-12-2024, 11:14 AM.
Comment
-
Hello,
The categorization does not explicitly imply this - if you have done the debugging please provide this as supporting evidence, along with a reduced sample script to reproduce.The categorization implies that the order is not from the script and as I previously said, both the chart data, backtest and prints suggest that no order should have been taken.
As discussed in your various posts about the topic, a strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest. Intrabar granularity needs to be properly implemented in order to have accurate results.I have also only noticed this issue when running a strategy live and it has never occurred in sim
Have you implemented 1-tick intrabar granularity?
Are you using the BarsInProgress index of the added 1 tick series for the order method calls? For example,
EnterLong(int barsInProgressIndex, int quantity, string signalName)
What is the BarsInProgress index you are supplying to the order methods?
During what BarsInProgress is the order submitted?Last edited by NinjaTrader_Gaby; 12-12-2024, 01:13 PM.
Comment
-
I have implemented 1-tick granularity, am using barsinprogress of added series. Your above statement address the issues between backtest and live, but not between live and sim. I don't know if there is an issue, just stating I have not had this issue in live simulation
Comment
-
Hello samish18,
I see, thank you for clarifying. I am seeing the mislabeling occurring with the Sim101 account on live data, however, from my testing the mislabeling does not also suggest that the mislabeled Default entry should not have occurred. I'm testing with the SampleMACrossover.I don't know if there is an issue, just stating I have not had this issue in live simulation
I look forward to receiving the output and reduced sample script that demonstrates that the mislabeled entry should not have occurred. Once again, to be clear, without the reduced sample and output to back this up, the only thing I can note in the report is that the Log message is mislabeled (not that the entries are wrong).
Comment
-
Just to clarify, when testing this, how often do you see it? I've seen it about 1-2 times a week when running 20+ strategies a day. It seems to only occur sometime when a strategy is taking it's first order since activation. Is this consistent with your experimentation?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
48 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
66 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment