exit end of day

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15943 quote
    Abz
    Participant
    Veteran

    hello

    is there a prameter for exit end of day without using time? when testing on daily chart i want the system to close the position at end of day.

    #15952 quote
    Elsborgtrading
    Participant
    Veteran

    Hi Abz, I think there will always be a definition on when is the end of the day- So you cannot ignore time. I mainly use two definition.

    defparam flatbefore=080000//no positions open before
    defparam flatafter=170000//all position will be closed after
    

    or

    //Trade hours- only opens positions during these hours.
    IF (Time >= 08000 AND Time <= 113000) OR (Time >= 130000 AND Time <= 170000) THEN // no trading during lunch
    Tradetime=1
     else
    Tradetime=0
    endif
    
    if <what ever condition> and tradetime then
    etc.. etc...
    
    #15978 quote
    Stef
    Participant
    Average

    PRT will always exit on the next bar open. There is no way to set it to exit on bar close.

    #15995 quote
    Elsborgtrading
    Participant
    Veteran

    Hi Stef. what is the difference? bar close= next bar open

    #16003 quote
    Stef
    Participant
    Average

    No. Bar open is not necessarily previous bar’s close. Think of instruments for which there is a defined market open and close – more often than not, the price will open higher or lower than the previous market close. With auction markets, there is also an auction in the morning before the market opens or before it closes in the afternoon. After the pre-market or post-market  auction, chances are that the next open will not equal the previous close. Another example would be for instruments where there is a lack of liquidity. Next bar can open anywhere, depending on where the next trade happens to take place.

    I guess it depends on what you are trading and what timeframes. For some markets and instruments it is not necessarily an issue. But still, you cannot assume this to be the case.

    PS: Some trading platforms allow you define backtests with ‘OPEN ON CURRENT BAR CLOSE’ vs ‘OPEN ON NEXT BAR OPEN’ – although automated trading systems have a hard time trading ‘ ON CURRENT BAR CLOSE.’

    Stef

    Elsborgtrading thanked this post
    Capture.png Capture.png
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

exit end of day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Abz @abbas_sadiq Participant
Summary

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

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