Vindruee

Statistical approach to risk management - Python script

教学
Vindruee 已更新   
CBOE:VIN   CBOE Near-term VIX Index
This script can be used to approximate a strategy, and find optimal leverage.
The output will consist of two columns, one for the median account size at end of trading, and one for the share of accounts liquidated.

The script assumes a 100% position size for the account.
This does not take into account size deviations for earnings and losses, so use with a grain of salt if your positions vary greatly in that aspect.

Code preview
cdn.discordapp.com/attachments/592684708551327764/848701541766529034/carbon.png
TradingView does not allow posting external links until you've reached a specific reputation, so i can't use the url feature

Input explanation
  • WINRATE : chance of winning trade
  • AVGWIN : average earning per winning trade
  • AVGLOSS : average loss per losing trade

  • MAX_LEVERAGE : maximum leverage available to you

  • TRADES : how many trades per account you want to simulate
  • ACCOUNTS : how many accounts you want to simulate

    the inputs used in the source code are from one of my older strategies, change them to suit your algorithm

Source code
pastebin.com/69EKdVFC

Good luck, Have fun
-Vin
交易开始:
Left a mistake in the code, here's an updated version:

Preview:
cdn.discordapp.com/attachments/592684708551327764/849339593798582312/carbon.png

Source code:
pastebin.com/0Vst4uJW
免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。