Given that the neural network indicator in Builder can involve a large number of calculations, it’s certainly possible that there could be rounding errors, but I don’t know why rounding errors would be different in live trading versus back-testing. More likely, the difference is in the live trading data versus back-testing data.
Mike Bryant
Adaptrade Software
I’m not sure what you’re suggesting. Calculations are calculations. It’s not as if the strategy is somehow going to calculate things differently on the same data because it’s live instead of a back-test. The fact that sim mode is different than live trading using the same data is hardly surprising. Sim mode is not exactly the same as live trading, despite the intent. Also, it’s not uncommon to rerun a strategy (e.g., turn it off and on again) and get a slightly different results on occasion. That’s usually because the data has been updated, so when you rerun it, it starts using the updated data. All it takes is one tick difference is some cases.
Again, I can’t see any way that the same strategy can cause two different results with the same input. It’s just computer calculations. Input determines output. Simple as that. And, just to clarify, the rounding error will be exactly the same if the data are exactly the same – it’s computer after all.
I was just referring to my past experience. You’ll have to look into the specifics of how your platform handles sim vs. real-time to find the differences. Obviously, sim is not live, so there is SOME difference.
There are certainly some differences in NT between live and back-test. I’m still trying to understand all of them, but it’s not surprising that you’d find some differences in results. I’ve never seen the consecutive up/down indicators give results in the 1000 range, but I’ll see if I can duplicate what you’re seeing. Have you seen the same in NT 8? I can’t promise that I’ll be supporting NT 7 indefinitely. I’ll add that there’s something suspicious about the NinjaScript framework if indicator code gives correct results in back-test but not in live trading. A good framework should be insensitive to simple things like that.
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of Nick
Sent: Friday, February 11, 2022 12:27 PM
Subject: Re: Neural Network output backtesting vs live - possible rounding discrepency?
Mike,
Some follow up... I might be on to something here. I added some debug code to print out the value of the NN Output incase a discrepancy occurred again. I was unfortunate to have another one hit today (Friday) but it showed there is a clear difference in the NN_Output, more than just a rounding issue. Note my platform is NT7.
Live trading - NNOutput= 0.67724112293824 2/11/2022 9:39:38 AMFriday, February 11, 2022
Backtest - NNOutput= 0.372221999142828 2/11/2022 9:39:38 AMFriday, February 11, 2022
The NN Inputs are coming from two variables:
VarL3.Set(Typical[BTAdjust]);
and
AS_ConsecBarsDn(Low)[BTAdjust];
Obviously typical price is going to be the same because the bar OHLC is all the same on the trigger bar. I DID however notice something interesting with the output of ConsecBarsDn. On my live chart, the value is always seems to be close to some level about 1000x more than it should be. More importantly, I can see clear areas where it's not actually calculating the bars down properly and skips one. On the back test chart, the ConsecBarsDn is calculating properly. Now, if I add ANOTHER AS_ConsecBarsDn(Low) to my live chart manually, it plots properly. So it seems something about the way the strategy is enabled live is making it different.
I'm not sure if this is causing the NN output difference during live trading, the only other explanation is some sort of issue with the neural network itself which is obviously much harder, if not impossible to debug.
--
You received this message because you are subscribed to the Google Groups "Adaptrade Builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adaptrade-buil...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adaptrade-builder/27d7e7d8-f0ef-49d8-8f48-b87bb020fea6n%40googlegroups.com.
I’ll let you know if I find anything.
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of Nick
Sent: Thursday, February 17, 2022 5:08 AM
Subject: Re: Neural Network output backtesting vs live - possible rounding discrepency?
Mike,
Any luck reproducing this issue or diagnosis the root cause?
The equality operator (“==” in NinjaTrader) works best with logical operands, such as in your CondL4 and EntCondL statements below where it’s comparing true/false conditions. When applied to real values, it works best as a way to exclude, rather than include; i.e., when comparing two real numbers, it should be the case that it will be false most of the time, which will tend to mitigate the effects of rounding. I would take that into account when screening strategies and possibly exclude the strategy if it looks like it’s relying on that operator for a true result when equating two real numbers.
Mike Bryant
Adaptrade Software
From: adaptrad...@googlegroups.com <adaptrad...@googlegroups.com> On Behalf Of antuan silvester
Sent: Tuesday, March 5, 2024 5:05 AM
Subject: Re: Neural Network output backtesting vs live - possible rounding discrepency?
Dear All.