Crypto position sizing - fractional tokens buys in backtests

Questions about MultiCharts and user contributed studies.
smhuggins
Posts: 12
Joined: 15 Mar 2015
Has thanked: 1 time

Crypto position sizing - fractional tokens buys in backtests

Postby smhuggins » 10 Aug 2021

Hello

Wondering if you can help please with fractional trading with crypto in portfolio backtester. This is based on spot tokens not futures.

Am using Binance data feed, and I want to accurately calculate position sizing (and performance metrics) in backtests in Portfolio Trader.

I've been told that Portfolio Trader does not allow buying fractional tokens, and that I need to use BigPointValue to reference and calculate the price Ratio for each crypto token.

I get this is perhaps a basic question, but struggling to find helpful syntax around this.

Normal code for stocks for a very basic position sizing formula is:

Code: Select all

input: PcntEquity ( 6.5 ) ; var: positionSize ( 0 ) ; Positionsize = ( Portfolio_Equity * PcntEquity ) / ( ( close ) / 100) ;
Could you assist in incorporating BigPointValue ?

thank you

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: Crypto position sizing - fractional tokens buys in backtests

Postby Vlada MultiCharts » 13 Aug 2021

Hello,

To calculate the position for Binance you can use the following formula as an example:

Code: Select all

Positionsize = PositionCost / close / BigPointValue ;
You can then round the result to the nearest whole number.


Return to “MultiCharts”