change amount of contracts

Forums ProRealTime English forum ProOrder support change amount of contracts

Viewing 7 posts - 1 through 7 (of 7 total)
  • #10546

    Hi all,

    Just a short question. In my prorealtime strategy, I have committed the line below for buying a contract.

    BUY 1 CONTRACT AT MARKET

    Before starting the strategy in proOrder, the system asks how many contracts you want to trade. I placed the following  number ‘4’. But because of the code it still keeps on buying 1 contract instead of 4. What do I have to change in the code to get the number of contracts that are put in when you start the strategy in ProOrder (4 contracts in this case).

    Thanks again.

    Gr. Pieter

    #10547

    Hi Pjotterd.

    There was an excellent post about money management but I can repeat it here. It will take into consideration how much your code earned, and place x amount of contract for you vs. your risk. It will accumulate your contract when you win and vice versa.

    //REM Money Management

    Capital = 1000

    Risk = 0.01

    StopLoss = 10 // Could be our variable X

    // Calculate contracts

    equity = Capital + StrategyProfit

    maxrisk = round(equity*Risk)

    PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)

    BUY PositionSize CONTRACT AT MARKET

    when the system ask how many contract you want to trade when preparing is the max contract you want to use.

    Br. Elsborgtrading

    #10548

    OK, thanks for this!

     

    #10549

    Are there any other options?

    #10568

    yes.

    //REM Money Management

    Capital = 1000

    Risk = 0.01

    StopLoss = 10 // Could be our variable X

    // Calculate contracts

    equity = Capital + StrategyProfit

    maxrisk = round(equity*Risk)

    PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)

    if PositionSize <=4 then

    PositionSize =4

    endif

    BUY PositionSize CONTRACT AT MARKET

     

    or.. raise the Risk = 0.01 to something higher, and look in the backtest result window under “orderlist” to see if you got the right number you want.

    #10576

    Cheers! Case closed 🙂

    #10593

    when you proved your code to be profitable it is still highly recommended to use the Money Management code. Just because it awesome and it actually managed your account so you don’t loose all your money in one deal. Trading is all about money management!

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

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