Trading system automatically stopped

Forums ProRealTime English forum ProOrder support Trading system automatically stopped

Tagged: 

Viewing 15 posts - 16 through 30 (of 36 total)
  • #116038

    That is exactly my experience! So either there is a problem in the code or there is a problem between IG and PRT. And then we are back to the “needle-in-a-haystack”. Can you spot anything else in the code that might cause this?

    #116040

    I might be speaking too soon, but I changed so SP = 2 and it has not been Rejected (yet!).

     

    1 user thanked author for this post.
    #116045

    I might be speaking too soon

    Still no Rejection after 16 mins so SP = 1 looks like the problem?

    I’ll keep monitoring and report back.

    1 user thanked author for this post.
    #116052

    Rejected again but it took nearly 1 hour this time!

    Well weird??

    1 user thanked author for this post.
    #116064

    I’ll like to help but I do not see anything in the code that would suggest this behavior. But please test these, in the same order:

    1. restrain the whole code to a time condition: if time>=010000 and time<073000 then …. YOUR CODE …. endif
    2. use a period of more than just 1 period for the calculation of the stochastic (variable SP)
    3. Did you try on a 5-minutes timeframe? (I know it is not the desired TF, but ..)
    1 user thanked author for this post.
    #116084

    SP = 2 on 1 min TF stopped again but it took about 3 hours this time (1 hour last time).

    SP = 1 on 5 min TF got stopped, but it took about 3 hours.

    SP =10 on 1 min TF is still running after 3 hours.

    1 user thanked author for this post.
    #116086

    Thanks GraHal for your big effort here, I really appreciate it!

    I have replaced the stochastic with one line of code, since I only need an intrabar view on the close vs. high and low. The code now looks like this:

    K = ((close-low)/(high-low))*100

    Very close to stochastic, but now I don’t have to worry about the highest/lowest in relation to one bar only.

    The strategy still stops though.

    Then I have followed suggestion from Nicolas and “wrapped” all code in an “if time>=010000 and time<073000 then” statement, though after the defparam lines, since they need to come before anything else in any code as far as I remember. I suppose I will have to wait and see till tomorrow morning if this has an influence.

    I will revert.

    #116087

    I’ve incorporated the changes you mention above and set that version going so we can compare!

    Sleep Well! 🙂

    1 user thanked author for this post.
    #116117

    All versions stopped except SP = 10.

    In backtest SP = 10 makes zero / 0 Profit (due to zero Trades over 100k bars).

    Why is the SP = 10 System the only System (out of our trials) that does not get stopped??

    No entries for any stoppages under Rejected / Cancelled in the Orders List.

    Stopped error message is attached. All my versions stopped have DEFPARAM PreLoadbars = 10000.

    Point to Note:

    Stoppages occur outside of trading hours (see numerous evidence in comments above) so it is not when a System tries to execute a trade that the System is stopped.

     

    1 user thanked author for this post.
    #116119

    JASS and I have tried numerous versions, so for reference … below is the only code version that has NOT been stopped.

    The version below has been running since 14:37 yesterday 6 Jan 20.

     

    1 user thanked author for this post.
    #116147

    Ok, so my conclusion goes for the stochastic period, that must be superior to 1. If there is no bar (or “phantom bar”), the 1 period calculation leads to a division by zero at line 50.

    You could also try this version of the calculation, it should also work with a 1-period:

     

    2 users thanked author for this post.
    #116151

    JASS got rid of the stochastic and it was still stopped, but maybe he still ended up with a divide by zero error (if no bar or phantom bar) with his amended code. See his post here …

    https://www.prorealcode.com/topic/trading-system-automatically-stopped/page/2/#post-116086

    I will try your code Nicolas thank you.

     

    1 user thanked author for this post.
    #116163

    Over 2.5 hours … so far so good using Nicolas code!

    The no bar / phantom bar causing a divide by zero error would account for the Rejection / Stop being random … due to a no bar occurrence being random!

    1 user thanked author for this post.
    #116166

    just returned home after a long day, will answer tomorrow

    #116178

    I moved the topic into the ProOrder section, it is now more related to automated trading coding than a platform issue.

    1 user thanked author for this post.
Viewing 15 posts - 16 through 30 (of 36 total)

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