I have been working on a script to provide various daily pivot values where various variants have already been posted by eSignal and others to provide OHLC (today and previous day values), trader pivots (PP, R1, S1, R2, S2) and the like. However I have been looking to have some more information and additional flexibility.
There have been a number of issues that I have come across that either I am ignorant how to resolve or maybe that functionality does not exist in current efs scripting:-
1. Finding first bar indexes of any days before yesterday
Code fragment
tNowM = getValue("rawtime");
nTdyIdxM = Math.abs( getFirstBarIndexOfDay(tNowM) );
tYdyM = getPreviousTradingDay(tNowM) ;
if(tYdyM != null){
nYdyIdxM = Math.abs( getFirstBarIndexOfDay(tYdyM) );
}
Now you are able to draw lines from the index value (specifically the first bar of today or yesterday) to the current position for any OHLC values and/or extract various pivots based on a vast array of pivot formulae if desired and project that to the current day. What would be the method to find the indexes of any days before yesterday's?
2. Finding the specific bar index of specific events during the day.
I would like to pinpoint the high and low of any trading day so that a line is drawn (intraday) from that bar index to the current index, how can this be done? Currently I have lines drawn from the first bar of the day either todays or yesterdays. I want to achieve this without resorting to further coding for intraday action.
3. Adjusting the open & close
With stocks, extracting daily OHLC values is normally satisfactory as they more or less match cash trading hours values (ie all pre and post market values are ignored).
However in continuous futures such as indexes, the open & close values are not what is normally desired in order to derive pivot information intraday, even though the daily information is technically correct which includes all trading action (ie opposite to what is provided by stocks).
You are then forced to look to intraday data to extract appropriate open/close data during cash open hours, this imposes more coding and a great performance hit. Changing the time template has no effect. It would be nice if there was a simple function built into efs to get this data easily without having to resort to complicated coding.
Specifically I want to see the whole data set in continuous futures, but be able to call the open and close at specific times to match the cash market hours.
If anyone has any suggestions and/or thoughts on these matters I would appreciate any feedback.
Robert
There have been a number of issues that I have come across that either I am ignorant how to resolve or maybe that functionality does not exist in current efs scripting:-
1. Finding first bar indexes of any days before yesterday
Code fragment
tNowM = getValue("rawtime");
nTdyIdxM = Math.abs( getFirstBarIndexOfDay(tNowM) );
tYdyM = getPreviousTradingDay(tNowM) ;
if(tYdyM != null){
nYdyIdxM = Math.abs( getFirstBarIndexOfDay(tYdyM) );
}
Now you are able to draw lines from the index value (specifically the first bar of today or yesterday) to the current position for any OHLC values and/or extract various pivots based on a vast array of pivot formulae if desired and project that to the current day. What would be the method to find the indexes of any days before yesterday's?
2. Finding the specific bar index of specific events during the day.
I would like to pinpoint the high and low of any trading day so that a line is drawn (intraday) from that bar index to the current index, how can this be done? Currently I have lines drawn from the first bar of the day either todays or yesterdays. I want to achieve this without resorting to further coding for intraday action.
3. Adjusting the open & close
With stocks, extracting daily OHLC values is normally satisfactory as they more or less match cash trading hours values (ie all pre and post market values are ignored).
However in continuous futures such as indexes, the open & close values are not what is normally desired in order to derive pivot information intraday, even though the daily information is technically correct which includes all trading action (ie opposite to what is provided by stocks).
You are then forced to look to intraday data to extract appropriate open/close data during cash open hours, this imposes more coding and a great performance hit. Changing the time template has no effect. It would be nice if there was a simple function built into efs to get this data easily without having to resort to complicated coding.
Specifically I want to see the whole data set in continuous futures, but be able to call the open and close at specific times to match the cash market hours.
If anyone has any suggestions and/or thoughts on these matters I would appreciate any feedback.
Robert
Comment