max number of open trades??

Forums ProRealTime English forum ProOrder support max number of open trades??

Viewing 6 posts - 1 through 6 (of 6 total)
  • #30207

    DOES ANYOEN HAVE THE CODE FOR

     

    max number of open trades??

    EG YOU WANT YOUR ALGO TO ONLY have a max number of open trades to be 5 ( so it wont open any more trade in 5 are already open)

    or

    have a max number of open trades to be 1 ( so it wont open any more trade if 1 is are already open)

     

    #30373

    Everything’s related to ProBacktest/ProOrder coding can be found in the online documentation: https://www.prorealcode.com/documentation/category/probacktest/

    You are looking for COUNTOFLONGSHARES and COUNTOFSHORTSHARES

    #30455

    thanks

    #30553

    do you know how to limit the max number of trades placed in one hour ? eg have the algo place no more than 3 trades in any one hour period?

    #30572
    Didn’t say what timeframe you are using, have used 5 minute chart to get 12 bars  e.g.  3 minute bars would be 20 bars.  Only takes a position if third last trade was over an hour ago.
    NumberOfBarsInHour = 12
    TradeBar = TRADEINDEX(3)
    if TradeBar = 0 or (barindex – TradeBar > NumberOfBarsInHour) then
    //if some condition then
    //buy or sell
    //endif
    endif
    2 users thanked author for this post.
    #31865

    thanks auto strategist!

     

    I am using a 2 min chart – this is my code

     

    NumberOfBarsInHour = 30
    TradeBar = TRADEINDEX(3)

    if TradeBar = 0 or (barindex – TradeBar > NumberOfBarsInHour) then

     

     

    do i need to add anything else to it or will the above code limit my system to trade 3 times per hour max ?

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

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