System works in backtest but crashes in real time

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #169401 quote
    Crocogotter
    Participant
    New

    Hi

    I’ve used a few different codes to try to run my system, but the latest one works fine for backtesting, loads up OK for Pro-Order, but then crashes and I get an error message advising me to modify it and backtest  it. My problem is that the current coding backtests fine, but crashes in use, so I wonder if there’s anywhere in particular I should be looking at given the error message (eg does the “ex:(-10)” relate to anything specific or is it a generic error code?).

    Obviously I’ve read what it says, but I’m confused as to why a parameter can’t equal zero; if we define a parameter why wouldn’t it be allowed to equal zero?

    Many thanks in advance.

    Trading-system-crash.png Trading-system-crash.png
    #169406 quote
    Nicolas
    Keymaster
    Master

    That error message is talking about the way you have set a period for an indicator, example:

    var = average[myPeriod](close)

    If for any reason, “myPeriod” equal 0 or a negative value, then the program will crash. As it is not really a problem while backtesting, it could devastating in real time situation with real money. So just check all of your indicators period first.

    Crocogotter thanked this post
    #169410 quote
    Crocogotter
    Participant
    New

    Ah, OK, great, many thanks, I know where to start looking. Thanks for explaining, that makes sense, and I have included a time period bit of coding in this version so that’s very likely to be the problem.

    #169421 quote
    Crocogotter
    Participant
    New

    Thanks again, I made a very small modification (added +1 so the parameter can’t be zero) and the code has successfully executed a (winning :-)) trade this afternoon and is still running. Much appreciated.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

System works in backtest but crashes in real time


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Crocogotter
4 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/11/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...