Omit sunday candle

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #51066 quote
    Despair
    Blocked
    Master

    Is there a way to really omit the sunday candle so it doesn’t increase the barindex? I would want friday to be say bar index 1000 and then monday shall be 1001 and not 1002 because of the sunday candle.

    #51069 quote
    Nicolas
    Keymaster
    Master

    Make your own barindex counting only if we are not on Sunday:

    if open[0]<>lastopen and opendayofweek<>0 then 
     lastopen = open[0]
     mybarindex=mybarindex+1
    endif
    
    return mybarindex
    Despair thanked this post
    #51081 quote
    Despair
    Blocked
    Master

    This was a good idea Nicolas but will not work for addressing a special bar. If I for example need the close 25 of my bars (without sundays) back

    c=close[myindex-25]

    will give wrong results. One would also have to count how many sundays where omitted and then add this number when addressing a bar because PRT internally still counts the sundays. :-S

    Another question, do you have a good idea how to check if the underlying in question has a sunday bar? I’m working on an indicator that counts bars but it shall not count sundays. It works nice on assets that have no sunday bar but if there is a sunday bar it becomes wrong.

    #51084 quote
    Nicolas
    Keymaster
    Master

    Just test if your security has a opendayofweek=0, if not, there is no Sunday.

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

Omit sunday candle


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Despair @despair Blocked
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/31/2017
Status: Active
Attachments: No files
Logo Logo
Loading...