Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Change order size when sharp ratio is above 1.5
Collapse
X
-
Change order size when sharp ratio is above 1.5
how can i tell ninjatrader to trade 2 contracts when the sharp ratio for the strategy is above 0.5 and trade only 1 contract when its bellow 0.5Last edited by wallsteetking; 04-03-2014, 08:58 PM. -
wallstreetking, you could access the SharpeRatio in NinjaScript and therefore adjust the qty used in your Enter() calls accordingly - http://www.ninjatrader.com/support/h...harperatio.htm
The call above is using a zero risk free return, if you wish to supply a custom one, use this call -
BertrandNinjaTrader Customer Service
-
This is what I have so far. The issue I have is, I have no idea how to tell ninjatrader to go long 2 CONTRACTS when sharp ratio is above .4 and trade only 1 contract when its bellow 0.4.Can you please guide/help me on the right direction. Furthemore, this has multiple strategies running at the same time, thats why I have Strat1.....etc on here.
Important: when i run the strategy with 1000 days back i get 500 trades but when i run the strategy with 6000 days back i get only 80 trades executed????? What going on?
Code:if ((Strat1 + Strat2 + Strat3 + Strat4 + Strat5>= myInt) Bars.BarsSinceSession <=150 && Bars.BarsSinceSession >=1 && [COLOR="Blue"][B]P[B]erformance.AllTrades.Count >= 1 && Performance.AllTrades.TradesPerformance.SharpeRatio >= 0.4[/B] ) { EnterLong(DefaultQuantity, ""); }[/B][/COLOR]
Comment
-
Correct, right now you just use the DefaultQuantity as your quantity in the EnterLong call, you would need to make that conditional based on the outcome you get from the SharpeRatio call. Either use your own qty variable that changes depending on the sharpe or multiply your DefaultQuantity then by 2 for situations where it's > 0.4.
As for the different trade groupings you see in backtesting, would not know - I would suggest to isolate out and run for example a single strategy only and checking out when the issue would be thrown exactly so you can fix.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
1 view
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
4 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
45 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
6 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
9 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
Comment