BCParticipant
Master
PositionSizeLong = MIN(10,MAX(0.5,abs(round((LongMaxRisk/(Close*(MaxSLPrecentageLong/100))/PointValue)*pipsize))))
Hi PRT Master
Above code give the contract size result as 0.5, 1, 2, 3, 4……10.
What command should use to make it 0.5, 1, 1.5, 2.0, 2.5……..10?
Thanks.
I have not tested it for lack of missing values, but this is your line as I modified it, plus another line to avoid 0.1, 02, …
PositionSizeLong = abs((round(((LongMaxRisk/(Close*(MaxSLPrecentageLong/100))*10)/PointValue)/10)*pipsize)
PositionSizeLong = PositionSizeLong - (PositionSizeLong MOD 0.5)
BCParticipant
Master
Thanks Robert
But I found below command was return to nothing.
Test = 0.5 - ( 0.5 MOD 0.5)
You are right, the MOD operator only works with integer results.
Try replacing 100 with 200 in your first line posted.