Hold maximum Ordersize

Forums ProRealTime English forum ProOrder support Hold maximum Ordersize

Viewing 2 posts - 1 through 2 (of 2 total)
  • #89524

    Hallo Forum,

    I need your help.

    I want to programm the following code below, but if I reached for example an Ordersize of 3,  I want to hold the Ordersize until the strategyprofit is >0 or  the loss is higher and I have to increase the Ordersize. If the strategyprofit reduce I want to hold the maximum reached Ordersize until the strategyprofit is > 0.

    I hope you can help me.

     

    If strategyprofit >= 0 Then

    OrderSize = 1

    Elsif strategyprofit <= -200 Then

    OrderSize = 5

    Elsif strategyprofit <= -150 Then

    OrderSize = 4

    Elsif strategyprofit <= -100 Then

    OrderSize = 3

    Elsif strategyprofit <= -50 Then

    OrderSize = 2

    Endif

    #89549

    Try this (not tested):

    But your, and mine, code will never reach OrderSize = 2.

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login