I have developed a BackTaster for a BitCoin strategy, however I have been unable to sell/buy fractional volumes (like 0.01 BitCoins). It looks like the volume is always rounded to the nearest unit. How can I fix that? Thanks!
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
ONCE InitialCash = 10000
CurrentCash = InitialCash + STRATEGYPROFIT
Units = ( CurrentCash/10 * 0.5 ) / Close
// Conditions to enter long positions
indicator1 = CALL "MyIndicators: CriptoFondU"
c1 = (indicator1 = 1)
IF c1 THEN
BUY Units CONTRACTS AT MARKET
ENDIF
// Conditions to enter short positions
indicator2 = CALL "MyIndicators: CriptoFondU"
c2 = (indicator2 = -1)
IF c2 THEN
SELLSHORT Units CONTRACTS AT MARKET
ENDIF
The first unit can be 0.5, then it must always be a whole number starting from 1. Then buy 0.5 units / lots / contracts or 1, 2, 30, 1000 … The closure must always be total, partial closure is not yet allowed.
Grazie/Thanks Roberto! That makes the BackTester basically unusable for the Forex or Cryptos traded through CFD’s. No good news.
Sorry for speaking italian, I just translated it.
Sorry as well about the Italian title, I thought I was posting this in the Italian forum.