Position sizing function not working properly

Forums ProRealTime English forum ProOrder support Position sizing function not working properly

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

    Hi all,

    I have written a simple trend following strategy that works across multiple markets. A Stoploss is placed behind most recent swing high/low and then a position sizing function uses the distance from the entry to the stop to set position size according to maximum permissible risk. However when running this strategy in realtime I have been finding that position sizes are often much larger than the 1% risk allowance. For example I set my account size to 36,000 so a 1% max position size should be capped at 360. This morning the entered position had a risk of 1547 (4.3% of account size). The code for the strategy is pasted below. Does anyone have any ideas as to why the position sizing function is working incorrectly?

    Thanks

    Roj

     

    #104604

    I figured it out. Just need to remove the

     

     

    multiplier at the end – was redundant

     

     

    works as anticipated

     

    2 users thanked author for this post.
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