Sunday bars
Forums › ProRealTime English forum › ProBuilder support › Sunday bars
- This topic has 8 replies, 5 voices, and was last updated 7 years ago by alvestjo.
-
-
03/28/2017 at 9:21 PM #30183
Hi all,
Just finding my feet with this system so have a simple question. Is there anyway to ignore the sunday bar when backtesting? I know I can remove it from the charts however it appears that when i write a rule and backtest it still takes it into account. Thanks for your help.
03/29/2017 at 3:40 PM #3021803/30/2017 at 9:03 AM #30266Hi Nicolas,
My strategy entry is on the previous bars high so i ideally want to be able to backtest without the sunday bar being factored in. Is this possible?? I have worked out how not to trade on the sunday bar. Thanks for the reply.
03/31/2017 at 9:32 AM #30471If you are using the previous day High to decide your entry condition, just add a comparison with the day of the week to know you are not using the Sunday bar:
12345if DayOfWeek[1]=7 thenmyHigh = High[2] //store friday high is yesterday was SundayelsemyHigh = High[1] //else we store the previous day highendifThen use myHigh value in your conditional statement instead of High. Hope it is clear.
1 user thanked author for this post.
04/27/2017 at 5:11 AM #33615Hi Nicolas,
I have a similar requirement to ignore Sunday bars.. Ideally My strategy is affected by the Sunday bars as (1) I count the number of preceding bars for re-entry (2) I use daily closes.
Is there a way to backtest without Sunday Bars?
I used DayOfWeek to overcome the situation, but there’s an error. Please look at my screenshot. I “graph DayofWeek”. Thursdays, Fridays and Sundays all return the value of 5.. Is there a bug?
Thanks!
CY
04/27/2017 at 10:47 AM #33665Are you in a Weekly timeframe?
Also, a quick tip to get the day of the week when the bar has opened, is to use OpenDayOfWeek instead.
04/29/2017 at 9:20 AM #33937Hi Nicolas,
Thanks for the info!
I’m using Daily bars.
I’ve swapped OpenDayofWeek for DayofWeek. It works better now, with Monday = 1, Tues = 2.. But both Fridays and Sundays have the value of 5.. My code is:
IF not LongOnMarket AND Count = 3 and OpenDayofWeek <> 5 THEN
StopLoss = close – 2 * AverageTrueRange[40](close)
BUY PositionSize shares at marketEndif
That basically also rules out entering the market on Fridays too..
Any suggestions?
Thanks!
CY
09/30/2017 at 12:04 PM #4786511/14/2017 at 8:22 AM #52658Hi,
I have the same problem. Dayofweek is not 7 for sundays in daily graphs. It must be a bug.
However I did find a trick to identify if a bar is a sunday. The costant “Hour” is 23 when the script is run on a sunday and 1 (i think) on normal weekdays.
//Jonas
-
AuthorPosts
Find exclusive trading pro-tools on