Hi all,
Just wanted to share a version snippet of my money management code from the strategy I posted here:
http://www.prorealcode.com/prorealtime-trading-strategies/usdjpy-trading-strategy-1mintf-sar-ema/
The idea is to increase position sizes to a function of Live Equity balance. However, if win or loss streaks (>3) occur, significantly scale up or down position sizing.
Any questions or suggestions welcome!
//MONEY MGT//
Ratio = 1.5
Equity = (Strategyprofit + 20000 ) //20,0000 Yen
Risk = round (Ratio* Equity/ 100000 ) //100,000 Yen
Losses = positionperf (1 )< 0 and positionperf (2 )< 0 and positionperf (3 )< 0
streak = positionperf (1 )> 0 and positionperf (2 )> 0 and positionperf (3 )> 0
if losses then
n = max (abs (round (max (3 + risk- 2 ,risk- 2 ))),2 )
elsif not losses then
n = max (abs (round (max (3 + risk,risk))),2 )
endif
if streak then
n = max (abs (round (max (5 + risk,risk))),2 )
endif
//
3 users thanked author for this post.