Below is a portion of the EFS code I built to determine the relationship of two indicators on an intraday chart at a specific time of day. I simultaneously use this code on four time frames for the equities markets. I also have my time templates set for equity RTH-East Coast (9:30-16:00)
You’ll notice that I use getHour() == 15 and getMinute() == 58 in my code. This works great except when the last bar of the day is not the time I specify in the code.
Therefore, is there a last bar of day function that knows which bar is the last bar of the day on an intraday chart?
I know I’m going to have issues with this code on Good Friday and other days where the market closes before 4 PM EST.
Thanks in advance.
function main() {
if (
vToday < vExpire &&
getInterval() == 2 &&
vEMA50.getValue(MAStudy.MA) > vEMA200.getValue(MAStudy.MA) &&
getHour() == 15 &&
getMinute() == 58
) onAction1();
//}}EFS_Expression_1
//{{EFS_Expression_2
if (
vToday < vExpire &&
getInterval() == 2 &&
vEMA50.getValue(MAStudy.MA) < vEMA200.getValue(MAStudy.MA) &&
getHour() == 15 &&
getMinute() == 58
) onAction2();
//}}EFS_Expression_2
You’ll notice that I use getHour() == 15 and getMinute() == 58 in my code. This works great except when the last bar of the day is not the time I specify in the code.
Therefore, is there a last bar of day function that knows which bar is the last bar of the day on an intraday chart?
I know I’m going to have issues with this code on Good Friday and other days where the market closes before 4 PM EST.
Thanks in advance.
function main() {
if (
vToday < vExpire &&
getInterval() == 2 &&
vEMA50.getValue(MAStudy.MA) > vEMA200.getValue(MAStudy.MA) &&
getHour() == 15 &&
getMinute() == 58
) onAction1();
//}}EFS_Expression_1
//{{EFS_Expression_2
if (
vToday < vExpire &&
getInterval() == 2 &&
vEMA50.getValue(MAStudy.MA) < vEMA200.getValue(MAStudy.MA) &&
getHour() == 15 &&
getMinute() == 58
) onAction2();
//}}EFS_Expression_2
Comment