Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Commission for forward testing
Collapse
X
-
Commission for forward testing
How can I apply commission for my forward testing? I have only been able to get this to work for backtesting. I have a strategy enabled on a chart, I see no commission field to enable and the strategy performance indicates $0 commission even though though backtesting with strategy analyzer states otherwise.
ThanksTags: None
-
Can you please post a screenshot of how you would have your commission to use setup in NT? If you toggled the 'apply commissions to pnl' setting it would generally need a freshly loaded instance of the script to take effect, no a reload of your NinjaScript on the chart.BertrandNinjaTrader Customer Service
Comment
-
I tested this on the NinjaTrader MA crossover strategy and commission is applied, but not on my strategies. I do have some code in the strategy dealing with PnL could that be interfering with the proper application of commissions. If so how could this work for applying commissions and setting my PnL shown in the code below?
Thanks
protected override void OnBarUpdate()
{
if (Bars.FirstBarOfSession)
{
// Store the strategy's prior cumulated realized profit and number of trades
priorTradesCount = Performance.AllTrades.Count;
priorTradesCumProfit = Performance.AllTrades.TradesPerformance.Currency.C umProfit;
}
// Prevents further trading if the current session's realized profit exceeds limits
if (Performance.AllTrades.TradesPerformance.Currency. CumProfit - priorTradesCumProfit <= -400)
{
// Returns out of the OnBarUpdate() method. This prevents any further evaluation of trade logic in the OnBarUpdate() method.
return;
}
Comment
-
Hello Chris001,
Thank you for your patience.
May I test your strategy on my end? If so, please attach the .cs file of your strategy to your response. You will find the file in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Strategy
If you prefer, you can send the strategy to support[at]ninjatrader[dot]com with 'ATTN: Patrick - 1066793' in the subject line.
Comment
-
I copied my strategy and spent some time cleaning it up, then debugging after cleaning it up a bit. I have no idea what it was, I made changes through all sections of the strategy so it could have been from anywhere for all I know, but it is ok now. I am going to continue working on this copied version but if this problem is encountered again I will let you know. Thanks
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kujista, Today, 06:23 AM
|
2 responses
6 views
0 likes
|
Last Post
by kujista
Today, 08:08 AM
|
||
Started by f.saeidi, Today, 08:03 AM
|
0 responses
4 views
0 likes
|
Last Post
by f.saeidi
Today, 08:03 AM
|
||
Started by cre8able, 04-17-2024, 04:16 PM
|
7 responses
64 views
0 likes
|
Last Post Today, 08:01 AM | ||
Started by Aviram Y, 08-09-2023, 09:04 AM
|
11 responses
299 views
0 likes
|
Last Post
by arjandezeeuw
Today, 08:00 AM
|
||
Started by Christopher Leggit, 02-15-2024, 09:00 AM
|
3 responses
47 views
0 likes
|
Last Post
by rdtdale
Today, 07:57 AM
|
Comment