Problem with position size #1134
Unanswered
raphaela13
asked this question in
Q&A
Replies: 1 comment
-
No, with these settings it will open position for 1K and you'll have 99K cash if long or 101K cash if short. You manage risk using stop-losses and whatever you put in You may find this repo - https://github.com/s-kust/python-backtesting-template - helpful. It's an advanced template. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I really struggle with the position sizing. From what I read, a number between 0 and 1 is suppose to be the fraction of current available liquidity. The data is only one loss to see the risk taken per trade, I have 100k cash and size = 0.01 which is suppose to risk 1000 per trade.
After the loss, the equity has only be reduced by 14$ so I really don't get it, I tried many different things but I don't understand.
The trade is a sell, it says to put a negative order size for short orders but I get an error "size must be a positive fraction of equity, or a positive whole number of units"
It could only be opening 0.01 lot but then how can we get a portion of the balance?
I attached the code and the stat display.
Thanks a lot for your help!
Start 0.0
End 238.0
Duration 238.0
Exposure Time [%] 0.41841
Equity Final [$] 99986.16685
Equity Peak [$] 100000.0
Return [%] -0.013833
Buy & Hold Return [%] -0.261797
Return (Ann.) [%] 0.0
Volatility (Ann.) [%] NaN
Sharpe Ratio NaN
Sortino Ratio NaN
Calmar Ratio 0.0
Max. Drawdown [%] -0.013833
Avg. Drawdown [%] -0.013833
Max. Drawdown Duration 75.0
Avg. Drawdown Duration 75.0
Trades 1.0
Win Rate [%] 0.0
Best Trade [%] -0.013833
Worst Trade [%] -0.013833
Avg. Trade [%] -0.013833
Max. Trade Duration 0.0
Avg. Trade Duration 0.0
Profit Factor 0.0
Expectancy [%] -0.013833
SQN NaN
_strategy AH_grab
_equity_curve Equit...
_trades Size EntryB...
dtype: object
Beta Was this translation helpful? Give feedback.
All reactions