Time of candle opening vs time of candle closing
Forums › ProRealTime English forum › ProOrder support › Time of candle opening vs time of candle closing
- This topic has 9 replies, 4 voices, and was last updated 2 months ago by Brad.
-
-
10/07/2024 at 9:41 AM #238562
Hi All,
Could someone please confirm the logic in the following code?
Timing12345IF (DayOfWeek = 1 AND Time <= 080000) THENTrading = 0ELSETrading = 1ENDIFThe code specifies that no entries are allowed if it is Monday and the time is at or before 08:00.
What happens if my trigger candle meets all the entry conditions, opens at 08:00, and closes at 08:15? Is this considered a valid entry, given that the candle closes at 08:15?
Regards,
Brad10/07/2024 at 10:14 AM #238568trigger candle meets all the entry conditions, opens at 08:00
But it wouldn’t meet the condition Time <= 080000, you would need to use Time < 080000?
1 user thanked author for this post.
10/07/2024 at 10:28 AM #23856910/07/2024 at 10:48 AM #238577The candle that triggers the trade is the close of the 07:45 candle (which is < 080000) and then the trade is opened at 080000.
Did you try it with Time < 080000 (not <=) is the trade still opened at 080000?
EDIT / PS
Just cheked your ss and the trade is opened at 081500 after being triggered at the close of the 080000 candle … so that is correct as your code??
10/07/2024 at 11:02 AM #238580Exactly. As Grahal says, the activation occurs on the previous candle. The reason is that the condition
Time <= 080000
is true on the previous candle (at the close of the candle it is already 8:00).1 user thanked author for this post.
10/07/2024 at 11:31 AM #23858210/07/2024 at 11:53 AM #23858310/07/2024 at 12:17 PM #23858510/07/2024 at 3:15 PM #238604If you run this code you will se the entry ARROW plotted just under the candle labelled 08:00 every Monday, since the trade is actually entered at 08:00 because the order is placed when the 07:45 candle closes:
123456IF OnMarket THENSELL at MarketENDIFIF (DayOfWeek = 1 AND Time = 080000) THENBUY at MArketENDIFreplacing line 4 by this one, you will se the entry ARROW plotted just under the candle labelled 08:15 every Monday, since the trade is actually entered at 08:15 because the order is placed when the 08:00 candle closes.
1IF (DayOfWeek = 1 AND OpenTime = 080000) THEN10/09/2024 at 1:00 PM #238773Thanks Roberto
Small changes can make big differences!
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on