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
JSParticipant
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…
fj_pastor probably means
Once StartedTime = CurrentTime // Once is only executed once. Thus at startup / launch of the Indicator, after that not any more.
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
@fj_pastor
you should use plain text (without formatting characters) when posting.
Thank you 🙂
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
No, I have never heard of any platform constant returning such info.
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).