Issue with time exit

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #51163 quote
    victormork
    Participant
    Veteran

    I have had an issue with my time exit during the last week. Can this have something to do with the change from summer to winter time?

    I had one time exit set by:

    DefPARAM Flatafter = 180000

    This one worked in backtest and on demo but not on my live account.

    On a different strategy I had another one set by:

    if time>220000 or (dayofweek=5 and time>210000) then
    exitshort at market
    sell at market
    endif

    What is strange with the second one is that in the back test the time exit is working correctly all until yesterday’s position which is still open. (see screen shot)

    I do use the MFE trailing stop (https://www.prorealcode.com/blog/learning/trailing-stop-max-favorable-excursion-mfe/) in combination to the time exit on these two strategies but it has not been a problem before.

    Skärmavbild-2017-11-01-kl.-07.25.59.png Skärmavbild-2017-11-01-kl.-07.25.59.png
    #51165 quote
    victormork
    Participant
    Veteran

    When I run the backtest on the second strategy and change the time exit to 21:00 it stops where it should. Could this issue come from that the candle of 22:00-23:00 is missing and therefore it is no close to evaluate the code from? But in that case should the close not occur at the next closing candle since the time is after 22:00 or does it not happen then because the next candle is 00:00 which is smaller than 22?

    #51293 quote
    Nicolas
    Keymaster
    Master

    Time is the time of when the candlestick is Closed. The exact time of when the code is read.

    #51328 quote
    victormork
    Participant
    Veteran

    Thanks Nicolas! I understand that and I realised how that influenced my first error. However do you have an idea why I didn’t get an exit at 18:00 when I had flat after 180000 at the top of my system code?

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

Issue with time exit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
victormork @victormork Participant
Summary

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

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