Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Running Sim Strategies
Collapse
X
-
Tags: None
-
Hello,
I am not sure. I suggest that you debug it to see why. This has not happened to anyone else, so I suspect the issue is within you strategy(s):
Regarding the data issue, what are the data parameters you are using? Are you sure all instruments have data for the days you are using?DenNinjaTrader Customer Service
-
Hello,
I can look at your log and trace files if you would like, to see if there is anything, but the best thing to do is to have me test the strategy and see if I can reproduce this issue. Or you can have a fellow trader friend test it on his machine if you perfer that. Please post your strategy so I can produce this.DenNinjaTrader Customer Service
Comment
-
spacebalts67,
Just to be sure please ensure that the actual first starting bar of the chart is the same as it is in the chart tab of the Strategy Analyzer.
An identical strategy running with identical parameters on an identical data set will produce identical results. These things need to be absolutely the same. What I suggest is you actually disconnect from your data feed to ensure that NinjaTrader does not go and retrieve new data and overwrite your old data set between your strategy runs.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
First, you need to understand that backtesting and real-time are very different. http://www.ninjatrader-support.com/H...TimeVsBacktest
Next, to see what is happening you would then need to debug your strategy in real-time with TraceOrders = true along with Print() to help evaluate your conditions. http://www.ninjatrader-support2.com/...ead.php?t=3627
This would be the only way to evaluate what is going on under the hood.Josh P.NinjaTrader Customer Service
Comment
-
We have already reviewed your trace and logs and the way to proceed is for you to debug your strategy. I assure you NinjaTrader only makes trades when the code tells it to. If the code does not tell it to it will not trade. The only way you will know when the code justifies a trade is if you debug it. Unfortunately if you are unwilling to debug there is nothing more I can do on my end.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
This is what I have been trying to convey to you. From all of the differences I have already stated and you insist on them not being the case I would not know. Your traces and logs do not contain information I can use to track it down and as such the only way to proceed is for you to debug it. Unfortunately there is just no other way.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
I never implied I knew what your strategy is doing. This fact also makes it even harder for me to do anything. All you have provided me is trace and log information that only say that an order was placed and filled. This does not help in any way in determining why a strategy makes less trades in real-time.
As stated, the only way to proceed is to debug. You need to see when your strategy evaluates conditions to true and when it does not. Only then can you qualify if the strategy should have traded or not. This is the fact of the matter. If you do not debug and see if the strategy should actually trade there is nothing further I can do.
I assure you NinjaTrader will take trades when told to. Any inhibitors it may encounter will come up from debugging. I cannot assist you until you take the necessary steps in debugging your conditions and orders. Here are the links to debugging effectively again: http://www.ninjatrader-support2.com/...ead.php?t=3627
Josh P.NinjaTrader Customer Service
Comment
-
I have already linked you to the article that discusses this. For your convenience, here it is again: http://www.ninjatrader-support.com/H...TimeVsBacktest
Please pay special attention to the "Running a Strategy at the Close of a Bar or Tick by Tick" section where it discusses CalculateOnBarClose.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
I have requested you to debug your code several times. Reason for this step is because it will reveal exactly how the strategy evaluates its conditions as well as exactly what your orders are doing. If you are unwilling to take this step I cannot assist you any further.
As far as your if (Historical) question goes, this is the behavior you will see if actually placed in the right place:- With such a line in place all backtest results will be blank because none of your data is real-time data.
- With it in place in real-time, your strategy will effectively ignore all historical data on a chart and just process real-time data only. For sure it will not trade unless a real-time condition is evaluated to true.
Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
You do not need Visual Basic to do debugging. All you need to do to debug is use Print() throughout your code and read the output in the Output Window.
The only basic test you need to do is put a Print() inside your if-statements. This will output a line whenever your conditions are evaluated to true signifying a trade should have been placed here. If you never receive an output from this line it means that your conditions were never evaluated to true and no trades should have ever occurred. That is the very basic starting test to determine why you are not receiving orders in real-time.
Please keep in mind that your strategy will only evaluate real-time data with your if(Historical) segment in there. This means you have to have a cross occur on real streaming data. Just throwing your strategy onto a chart does not mean any of that data is real-time. In fact, all data preexisting on a chart are seen as historical data.
Code:if (CrossAbove(ZeroLagStochs().Smoothed, LONG, 1) && TSI(3, TSI1032)[0] > 0 && RSI(RSI1032, 3).Avg[0] > RSIL1032) { [B][COLOR=Red]Print(Time[0] + " ENTER LONG");[/COLOR][/B] EnterLong(DefaultQuantity, ""); }
Code:[B][COLOR=Red]Print(Time[0] + " CrossAbove: " + CrossAbove(ZeroLagStochs().Smoothed, LONG, 1) + " TSI Value: " + TSI(3, TSI1032)[0] + " RSI Value: " + RSI(RSI1032, 3).Avg[0] + " RSIL1032 Value: " + RSIL1032);[/COLOR][/B] if (CrossAbove(ZeroLagStochs().Smoothed, LONG, 1) && TSI(3, TSI1032)[0] > 0 && RSI(RSI1032, 3).Avg[0] > RSIL1032) { [B][COLOR=Red]Print(Time[0] + " ENTER LONG");[/COLOR][/B] EnterLong(DefaultQuantity, ""); }
If your conditions are all true at the exact same time and the "ENTER LONG" print was received yet you are still not able to receive any real-time orders then we can move on to the next step of debugging.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
You will need to have the Output Window open the entire time for it to catch the Print() messages. Since you are trying to see what happens in real-time I suggest you maintain the if (Historical). You are trying to determine when your orders would be sent in real-time and it is just a matter of waiting for your Output Window to produce such a print.
If you remove the if (Historical) segment you will get prints throughout your historical data. This is no different than as if it were running in a backtest and would not be as useful for determining real-time behavior.Josh P.NinjaTrader Customer Service
Comment
-
spacebalts67,
We do not offer custom programming services. You are working with code and as such debugging is a reality for you. If you do not wish to do this I suggest you contact one of the 3rd party NinjaScript Consultants here who do offer such services: http://www.ninjatrader.com/webnew/pa...injaScript.htmJosh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by spencerp92, 10-10-2023, 09:56 AM
|
4 responses
302 views
0 likes
|
Last Post
by flybuzz
Today, 06:45 PM
|
||
Started by samish18, Yesterday, 10:13 AM
|
1 response
23 views
0 likes
|
Last Post Today, 06:15 PM | ||
Started by Austiner87, Today, 05:02 PM
|
0 responses
5 views
0 likes
|
Last Post
by Austiner87
Today, 05:02 PM
|
||
Started by tonynt, 05-21-2019, 06:27 AM
|
10 responses
530 views
1 like
|
Last Post
by fiendtrades
Today, 04:29 PM
|
||
Started by awwenzovs, Today, 08:03 AM
|
2 responses
15 views
0 likes
|
Last Post Today, 04:27 PM |
Comment