Sunday data code
Forums › ProRealTime English forum › ProOrder support › Sunday data code
- This topic has 8 replies, 3 voices, and was last updated 2 years ago by
Tropic.
-
-
09/18/2022 at 8:48 PM #200980
Hi guys, i did a very simple system that buys if close is over yesterday Max and sells short if close is under yesterday Min. The problem is that he takes in consideration the Sunday data in that small time market is open ( in the Forex for example market session opens on Sunday at 23.00 at my GMT), so on Monday il will have a opened position based on that market Sunday small time data and i dont want this, want considerating only the data from Monday to Friday, how i solve this ? Without excluding trade on Monday possibly, thanks
09/19/2022 at 7:06 AM #200990Post your topic in the correct forum:
_ ProRealTime Platform Support: only platform related issues.
_ ProOrder: only strategy topics.
_ ProBuilder: only indicator topics.
_ ProScreener: only screener topics
_ General Discussion: any other topics.
_ Welcome New Members: for new forum members to introduce themselves.I moved it to ProOrder, as it deals with automated strategies.
Thank you 🙂
Which timeframe are you using?
09/19/2022 at 1:55 PM #201021Oh sorry, thank you Roberto.
I’m testing on timeframe h1 or h2 but. But consider that i use “dlow(1)” and “dhigh(1)” which take yesterday’s high and low regardless of the timeframe so that is not so important, i just need to exclude Sunday from reading the data
09/19/2022 at 3:08 PM #201028Then you need to replace Dlow(1) with Dlow(2) when it’s Monday (which is identified by OpenDayOfWeek = 1). Example:
12345678BarID = 1IF OpenDayOfWeek = 1 THWNBarID = 2ENDIFPriorLow = Dlow(BarID)Priorhigh = Dhigh(BarID)PriorOpen = Dopen(BarID)PriorClose = Dclose(BarID)09/19/2022 at 3:36 PM #201030Ok nice idea it seems to work , thanks!
Another question out of curiosity:
Is there a way to place an order on the same current bar instead of the next bar? Because I noticed that when he finds the right condition he place order and open the trade to the next bar anyway, there is a way to do it instantly in the same bar which find condition without waiting for the next bar?
09/19/2022 at 3:50 PM #201036Of course you can do that by using multi timeframe conditions, examples:
https://www.prorealcode.com/topic/sell-same-bar-close/#post-87943
https://www.prorealcode.com/topic/ouverture-immediate-position/#post-81939
First approach to multi timeframe trading with ProRealTime
1 user thanked author for this post.
09/19/2022 at 4:27 PM #201043ok thanks i tried but it doesn’t work because it tells me to use multiples of the timeframe default period. If I run it on h1 default and in the code I put smaller timeframes like 1 seconds or 5 minutes it gives me the error , is there a way to avoid it?
09/19/2022 at 4:43 PM #201046If you read the links above you will learn how to use multiple timeframes.
The DEFAULT timeframe is the one that sets the pace of execution and it is the one used on your chart and it MUST be the smallest timeframe used in your code. ALL other greater timeframes must be multiples of the default one.
If your default Timeframe is 15 minutes, then you can use 30 minutes, 1 hour (or 60 minutes), etc… but you CANNOT use 20 minutes, as it’s not a multiple of 15.
09/19/2022 at 5:54 PM #201051 -
AuthorPosts
Find exclusive trading pro-tools on