BlueCollarDayTrading Posted October 21, 2020 Report Share Posted October 21, 2020 Within a Paintbar Advanced script is there a function to reference time ie if TIME > 0930 (do XYZ) or if TIME < 0930 && TIME > 0900 (do ABC) Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 21, 2020 Report Share Posted October 21, 2020 Yes - you can check the time in relation to the current trading session for the candle. Use GetTradingSessionInfo - https://www.medvedtrader.com/trader/WebHelp/advanced_timestamp_and_trading.htm Than you can check what the info.SessionStart is and see if your Timestamp is past that. 1 Quote Link to comment Share on other sites More sharing options...
BlueCollarDayTrading Posted October 21, 2020 Author Report Share Posted October 21, 2020 Thank you, sir Quote Link to comment Share on other sites More sharing options...
BlueCollarDayTrading Posted October 21, 2020 Author Report Share Posted October 21, 2020 Ok it seems the indexed variable Timestamp would work. Q. I live in US Central time zone which is UTC -5. The market opens at 8:30 AM here. Which is 1:30 PM UTC. If I want to check a candles time do I use the time format 1:30 PM or 13:30 or 1330 ie //Time is between 8am CST and 830am CST if Timestamp < 1330 && Timestamp >= 1300 (do XYZ) //Market is open for regular trading hours else if Timestamp >= 1330 (do ABC) Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 21, 2020 Report Share Posted October 21, 2020 That is why we are providing for you the session info. So you don't have to convert times. You just do var Info = GetTradingSessionInfo(Timestamp); if (Timestamp > info.SessionStart.AddHours(1)) <--- this would check if we're past the first hour of the trading session 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.