Automated trading backtested code not working on live

Forums ProRealTime English forum ProOrder support Automated trading backtested code not working on live

Viewing 10 posts - 1 through 10 (of 10 total)
  • #154940

    Hi Guys,

    I’m new to coding in Prorealtime. I hope someone can help me with this.

    1. I have done some code for automated trading and backtested it.
    2. It works perfect in the backtest but when I execute this for autotrading on live, it does not work.
    3. But when I backtest the same code that wasn’t working on the live for those days in point 2 above, it works fine a couple of days later on backtesting.
    4. I suspect it may have been something to do with timezone? I don’t know.
    5. I’m in Australia so all my time zone are set to Australia/Sydney desktop time
    6. I’m trading US market indices

    Any help would be great. Please see the code below.

    What Am I doing wrong?

     

     

    #154942

    This is likely to have nothing to do with your issues, but as you used “p” with PROFIT you should use it with TRAILING as well.

    What does “it does not work”?

    What errors or wrong trades are reported?

    1 user thanked author for this post.
    #154944

    What maximum size of trade have you set? If this is under the minimum size for the instrument that you are trying to trade then no trades will be opened.

    Does the size you are trying to open meet the minimum size for that market?

    #154950

    10 CONTRACTS might be too much for your account? (free margin).

    #155063

    I’m not getting any errors. The code simple does not execute any trades in live.. although the code works fine in backtested for the same period.

    I’m using it in NASDAQ indicies US Tech 100 ($1) market.

    • The minimum size for this market is 0.5.
    • Although the code says BUY 10 contract,  I set a minimum contract to buy as 2 when you start the autotrading. Do I need to have the same quanty in the code and when you start ? (Please see the screenshot)
    • I do have enough margin in the account to be able to execute 10 contracts.

     

    I will try using the “p” with TRAINING.

    #155068

    What maximum size of trade have you set? If this is under the minimum size for the instrument that you are trying to trade then no trades will be opened.

    Does the size you are trying to open meet the minimum size for that market?

    Thank you for your reply. My code says 10 contract but I put 2 in maximum size.. ? Do I need to put 10 or more in the maximum size when I start the program?

    #155091

    The short answer is … Yes.

     

    #155104

    The Max Position box that you have to fill in before running a strategy live is quite simply a safety level that you set. It is useful if you have accumulating positions and want to set a limit to how many are allowed to be open at any one time. If your strategy only ever has one position open of a size of 0.5 then set it to 0.5.

    The setting is there to stop out of control strategies from emptying your bank account.

    1 user thanked author for this post.
    #155126

    The Max Position box that you have to fill in before running a strategy live is quite simply a safety level that you set. It is useful if you have accumulating positions and want to set a limit to how many are allowed to be open at any one time. If your strategy only ever has one position open of a size of 0.5 then set it to 0.5.

    The setting is there to stop out of control strategies from emptying your bank account.

    Thank you so much for your help.

     

    Thanks to everyone for your input. Thank you.

    #155165

    I changed trading hours to reflect CET (Utc+1) and it just opened a trade with 10 contracts at 18:30 (Utc+1), entry price 12697.5.

     

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

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