Close of the Week

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #38974 quote
    Pere
    Participant
    Veteran

    Hi all.

    Is there any trick to know the value of the Close of the Week? Or of Open of the Week?

     

    Thanks for the answers.

    #38975 quote
    Pinny
    Participant
    Junior

    You mean beside the obvious? Close and Open, when invokes in the weekly timeframe, will give you just that

    #38976 quote
    GraHal
    Participant
    Master

    Similar question if I may add to yours Petrus … is the Open of the Day considered to be Midnight (+ 1msec if you like) or the Open time of the Cash Market in the Instrument?

    Take for example the DAX, it closes at 16:30 (UCT+2) so is the + or – movement from 16:30  to 09:30 the next day (Dax open?) considered as + 60 points (for example) at Open??

    OR

    Is DAX value at midnight in Germany the Close and midnight + is the Open??

    Apologies Petrus not an answer to your question, but same / similar principles apply to yours and my question?
    GraHal

    #38977 quote
    Pere
    Participant
    Veteran

    Of course, Pinny, I’m referring to call the week close or week open if I am in a different timeframe, like 1 day, 1 hour or 5 minutes.

    #38978 quote
    Pere
    Participant
    Veteran

    Thanks for your answer Grahal, I totally agree with your questions/doubts. But I think we mix here two different questions.

    The close time depends on the indice, pair of Forex or share.

    But if we speak about DAX and weekly timeframe, for example, the close for the week is on 23:00 of Friday, and open of the week is on 0:00 of Monday. And I’m working with IG and CFDs, which makes sometimes the problem bigger. You only have to see the graphics on different timeframes. The open-close of the futures is 9:00-17:30, and another problem of the CFDs is that I cannot see any gap between close of last day and open of today, because it is almost continuous.

    My question was only to call the weekly close (or open) value from another timeframe. Of course I can do it, but it seems too complicated for me, defining the close time for every índice, for every day, etc. But for example, in Tradestation there is an instruction like CloseM, CloseW, or CloseD to define the close for the month, week or day.

    GraHal thanked this post
    #38982 quote
    Pinny
    Participant
    Junior

    OK, understood

    #38983 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    There’s no direct command I’d be aware of to get open or close of the week, however the keyword “opendayofweek” giving the day number in the week at open of your candle in any timeframe can be used in combination with an “if” statement to retrieve monday’s open and friday’s close, therefore giving you open and close of week in any timeframe. Would look like this do the trick, to be tested:

    if OpenDayOfWeek=1 then
    a=DOpen(0)
    b=c
    endif
    if OpenDayOfWeek=5 then
    c=Dclose(0)
    endif
    
    return a as "open of the week", b as "close of previous week", c as "friday's live close of current week", 5200+OpenDayOfWeek*10 as "day of week"

     

    Above “a” is your current week open, “b” is your previous week close… “c” is just your live close on a friday as a temporary current week close, but of course would only be your real current week close at last tick on friday.

    You might wonder why I didn’t use Dclose(1) on a monday to retrieve previous week’s close, that’s simply because it would get “sunday night close” instead of friday’s for IG with such a syntax, so the way proposed above should nicely work around this, and get friday’s close regardless of dataflow being from an instrument with no sunday night data or a cfd with some sunday night data.

    GraHal, Nicolas and Bel thanked this post
    #38986 quote
    Pinny
    Participant
    Junior

    OK, understood

    I do have something but it will work only on the Daily timeframe so probably not very useful 🙁

    #38987 quote
    Pere
    Participant
    Veteran

    Thanks Noobywan.

    It’s a good idea to combine Dclose with OpenDayofWeek.

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

Close of the Week


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Pere @petrus Participant
Summary

This topic contains 8 replies,
has 4 voices, and was last updated by Pere
8 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/25/2017
Status: Active
Attachments: No files
Logo Logo
Loading...