change amount of contracts

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #10546 quote
    Pjotterd
    Participant
    Average

    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 quote
    Elsborgtrading
    Participant
    Veteran
    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 quote
    Pjotterd
    Participant
    Average
    OK, thanks for this!
    #10549 quote
    Pjotterd
    Participant
    Average
    Are there any other options?
    #10568 quote
    Elsborgtrading
    Participant
    Veteran
    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 quote
    Pjotterd
    Participant
    Average
    Cheers! Case closed 🙂
    #10593 quote
    Elsborgtrading
    Participant
    Veteran
    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)
  • You must be logged in to reply to this topic.

change amount of contracts


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Pjotterd @pjotterd Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by Elsborgtrading
9 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/18/2016
Status: Active
Attachments: No files
Logo Logo
Loading...