Is there any way to set the initial backtest account balance as it is not available in the list of accounts or anywhere in the options. Thanks.
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
Backtest Account - Set Values?
Collapse
X
-
Backtest Account - Set Values?
I want to simulate specific order handling with trade sizes etc based account data, cash value etc. To do this we can get the AccountItems but the problem is these are tied to the Backtest account when performing a backtest.
Is there any way to set the initial backtest account balance as it is not available in the list of accounts or anywhere in the options. Thanks.Tags: None
-
Hello fxRichard,
Thank you for your post.
When backtesting there is no means to set the values of the account. You would instead implement internal calculations in your strategy to calculate and track your own custom values for the desired account values.
For the Tick value use the following:
Code:double myTickValue = Instrument.MasterInstrument.PointValue * TickSize;
Code:double myNumTick = 1 / TickSize;
Comment
-
Thanks Patrick,
On a real/live account I assume we would have access to this information? Can we put in a feature request to be able to set the backtest account value and have this value update throughout the life of a backtest?
This is pretty simple stuff to add I would think and would allow those that do more advanced account management and order placement to use real calculations. The biggest thing is not being able to get the actual P&L or floating account balance as trades are won and lost.
To do this for backtesting only we have to implement extra logic that I assume is not necessary on a live account running on real time data.
Comment
-
Patrick,
Is there any way to determine the rolling P&L or floating CashValue of the account? Or do I need to monitor every trade in a backtest, calculate the win/loss and keep a dummy variable for this information.
Ie. a trade just closed with 5 ticks profit on CL, and thus we have to manually keep track of the fact that this is a $50 profit per contract and manually subtract commissions etc?
Comment
-
Hello fxRichard,
Thank you for your response.
Cash Value would need to be a variable you create and track for the strategy during the backtests. As far as profit you can use the TradePerformance: http://ninjatrader.com/support/helpG.../cumprofit.htm
I will forward your request to development.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Allwest, Today, 10:25 PM
|
0 responses
1 view
0 likes
|
Last Post
by Allwest
Today, 10:25 PM
|
||
Started by sevensa, 03-14-2024, 10:15 PM
|
3 responses
24 views
0 likes
|
Last Post
by sevensa
Today, 10:19 PM
|
||
Started by bertochi, 04-16-2020, 12:15 PM
|
30 responses
1,059 views
2 likes
|
Last Post Today, 09:36 PM | ||
Started by Lumbeezl, 01-11-2022, 06:50 PM
|
28 responses
756 views
1 like
|
Last Post Today, 09:23 PM | ||
Started by jourdale, 03-16-2024, 06:33 AM
|
3 responses
42 views
0 likes
|
Last Post Today, 06:44 PM |
Comment