Current XXX versus actual XXX

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #207086 quote
    fj_pastor
    Participant
    New
    Hello and thanks,
    
    I am coding an indicator and unfortunately is not possible to get the system time the moment you launch it.
    When you use currentXXX (example current month, you get the month of the candle being displayed)
    Is there a workaround for this (islastbarupdate is not a solution)
    
    Thanks in advance
    #207090 quote
    JS
    Participant
    Senior

    Hi @fj_pastor

    I don’t quite understand what you mean, just like with your indicator, everything is related to the price or the barindex…
    When you use, for example; xMonth=Month[0] then you get the current month, xYear=Year[0] then you get the current year, and so on…

    #207091 quote
    PeterSt
    Participant
    Master

    fj_pastor probably means

    Once StartedTime = CurrentTime   // Once is only executed once. Thus at startup / launch of the Indicator, after that not any more.
    #207129 quote
    fj_pastor
    Participant
    New
    Hello, thanks to all
    
    Let me explain myself:
    If you write an indicator and you
    want to perform something in the last candle but not before,
    you have no chance to identify it.
    
    Example. I want to draw something in the last candle after launching the indicator.
    
    I you test today a candle which opens and closes in December you get in the indicator:
    month returns 12
    currentmonth returns 12
    
    because currentmonth is referred to the candle, which is also the case for month.
    
    What I am looking for is an instruction that returns the system date and time, 
    not the candle the indicator is calculating.
    
    
    Thanks
    
    
    
    
    #207132 quote
    robertogozzi
    Moderator
    Master

    @fj_pastor

    you should use plain text (without formatting characters) when posting.

    Thank you 🙂

    #207137 quote
    fj_pastor
    Participant
    New

    Just trying.

    By the way, do you have an idea to get the system date and time, not the candle time, when you are launching an indicator ?

    Thanks in advance

    #207139 quote
    robertogozzi
    Moderator
    Master

    No, I have never heard of any platform constant returning such info.

    #207142 quote
    PeterSt
    Participant
    Master

    No, that is not possible. But I cannot imagine that what you functionally want is not accomplishable.

    So what do you actually want to do, functionally ? If you, for example, want to show the date/time of when you launched the platform this can easily be done. Or when you started the System (algo) can be done too (hard-code it). When you created the Indicator – same thing (hard-code it).

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

Current XXX versus actual XXX


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
fj_pastor @fj_pastor Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by PeterSt
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/08/2023
Status: Active
Attachments: No files
Logo Logo
Loading...