3acor Posted February 18, 2021 Report Share Posted February 18, 2021 Hey, How can I set the candle range to consider the current candle back until the first candle in the session start excluding premarket? Thanks Quote Link to comment Share on other sites More sharing options...
wilburpost2 Posted February 18, 2021 Report Share Posted February 18, 2021 Look at the help section: Advanced - Timestamp and Trading Session IsPreMarket Boolean true if the DateTime with which the TradingSessionInfo was created falls between DayStart and SessionStart Quote Link to comment Share on other sites More sharing options...
3acor Posted February 19, 2021 Author Report Share Posted February 19, 2021 20 minutes ago, wilburpost2 said: Look at the help section: Advanced - Timestamp and Trading Session IsPreMarket Boolean true if the DateTime with which the TradingSessionInfo was created falls between DayStart and SessionStart Thanks for the reply. But I need to put it in a range. For example the function: Any(0, "SessionStart", ......) Quote Link to comment Share on other sites More sharing options...
wilburpost2 Posted February 19, 2021 Report Share Posted February 19, 2021 Well I'm no code expert, but I think I would just write a loop and keep walking back until the IsPreMarket became true and see if I had a desired result. Since you're using Any( ), I might just exit early since the first instance would be a true result. I'll let the true coders suggest a compact way using the advanced looping functions or some other way. 1 Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted February 19, 2021 Report Share Posted February 19, 2021 Hm. It is not a trivial thing. If it is a timed chart, you can figure out how many candles it takes to session start by subtracting session start time from current candle timestamp and dividing by the candle size. Then use that number in the Any loop.... 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.