Hi everyone,
I have a question regarding my PRT Code. I wanted to define the position size so that the same risk in terms of $ value applies for each trade. Once I perform a backtest the position size varies and most of the time it is doing what it should. But there is also a significant number of exceptions where the result deviates too much from the original intention with 1:1 Risk/Reward.
Please find below the code and attached also a picture of the results with yellow marked deviations.
SL = (High - Low)
R = 500
Tickvalue = 2
OrderQty = Round ((R / SL) / Tickvalue),0)
//Conditions for Direction Short
IF .... THEN
Direction = -1
ENDIF
IF NOT OnMarket AND Direction = -1 THEN
SELLSHORT OrderQty CONTRACT AT (Low - 0.25*pipsize) Stop
SET STOP PLOSS (SL)*pipsize
InitialSL = SL
ENDIF
//Exit Short 1:1
IF ShortOnMarket THEN
SET STOP PLOSS (1*InitialSL)
SET TARGET PPROFIT (1*InitialSL)
ENDIF
The average position size is like 10-15 contracts, so it is not the problem that it is only 1 contract.
What is wrong in my code and what can I do better in order to have a proper position size for risk/reward calculation?
Thank you very much for your support.
Best regards
Simon
JSParticipant
Senior
Hi Simon,
In “Risk Management,” it’s common practice to risk only 1% of your capital per trade and base your position size on this, for example:
A lot has already been written on the forum about money/risk management, and if you check the library or search for “money management,” you’ll find plenty of useful information…