Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need a column inside a straight table, that can based on the EntryTime of the trade, tell me the starting time of the candle bar where the trade occurs.
Example: 8 minute bars, start counting bars from 3:30 PM
Trade: Entry Time: Starting time of Bar:
1 4/4/2017 5:04:00 PM 4:58 PM
2 4/18/2017 8:16:06 PM 8:10 PM
My session starts at 3:30PM (Field value), and based on the time-frame (8 minutes, 15 minutes, etc, also field value) it should tell you the start-time of the Bar that the trade belongs to.
For 8 min time-frame: First bar starts at 3:30 PM, then next at 3:38 PM, 3:46 PM, 3:54 PM,etc...
For 10 min time-frame: First bar starts at 3:30 PM, next 3:40 PM, 3:50 PM, etc..
For 13 min time-frame: First bar starts at 3:30 PM
Time-frame value comes from Time-frame field (8 min, 9 min, etc...)
Session start time comes from session field (3:30 PM, 8:30 AM, etc...)
This is currently how I have tried scripting it inside the straight table chart:
=time(floor(EntryTimeII,8/24/60)+maketime(0,2,0),'hh:mm:ss TT')
But it is not correct.
Here is the version where you can use a variable to determine start time
=Time(Floor(StartTime) + Time(Time#(vStart, 'hh:mm') + Floor(Frac(StartTime - Time#(vStart, 'hh:mm') + MakeTime(0, 0, 1)), vTime/1440)))