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 1 month ago by avatarBrad.
Viewing 10 posts - 1 through 10 (of 10 total)
  • #238562

    Hi All,

    Could someone please confirm the logic in the following code?

    The 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,
    Brad

    #238568

    trigger 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.
    #238569

    My concern is when testing it on the demo account, the trade is triggered.

    #238577

    The 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??

    2 users thanked author for this post.
    #238580

    Exactly. 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.
    #238582

    So, to avoid confusion, is the demo entry correct, as seen in the screenshot?

    #238583

    Yes, demo entry is correct as per your code … IF (DayOfWeek = 1 AND Time <= 080000) THEN

    1 user thanked author for this post.
    #238585

    Thanks for the clarification, gents. That means a live trade was not triggered.

    #238604

    If 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:

    replacing 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.

     

     

     

     

    3 users thanked author for this post.
    #238773

    Thanks Roberto

    Small changes can make big differences!

    1 user thanked author for this post.
Viewing 10 posts - 1 through 10 (of 10 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login