//{{Declarations
var vLastAlert = -1;
//}}Declarations
var AlertTTriggered = false; //added to cancel for the day
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{PreMain
setPriceStudy(true);
setStudyTitle("");
var AlertTriggered = false;
//}}PreMain
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* in your preMain(), it is also called on every tick.
*/
if (getDay(0) !=getDay(-1)){
AlertTTriggered = false; //added to cancel for the day
}
//Following is to compare any bar to the first bar of the day (need to set time template as desired)
var BarTime = rawtime(-1);
var BarIndex = (getFirstBarIndexOfDay(BarTime)-getCurrentBarIndex());
var FirstOpen = open(BarIndex);
var FirstHigh = high(BarIndex);
var FirstClose = close(BarIndex);
var FirstLow = low(BarIndex);
if(getBarState()==BARSTATE_NEWBAR)
{
}
AlertTriggered = false;
{
//{{Expressions
//{{Expression 1: For GL
if(
((getHour(0)*100)+getMinute(0)>936 && (getHour(0)*100)+getMinute(0) <1530)&&
low(-1) > low(-2) &&
high(-1) <= high(-2) &&
high(0) > high(-1) &&
AlertTTriggered == false &&
AlertTriggered == false
) onAction1();
//}}Ends GL - 9:30 L10 Version.
//}}Expressions: ENDS ALL Scripts Condition Statements Here
//{{Return
return null;
//}}Return
}
function postMain() {
}
//{{Actions
//{{Action_1 GL
function onAction1() {
drawTextRelative(-1, low(-1)-.060, "RV", Color.RGB(0,0,255), Color.RGB(0,255,0), Text.FRAME, "Arial", 10);
drawLineRelative(-1, close(-1) , 8, close(-1) , PS_SOLID, 3,Color. green, "line");
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\l10setup.wav");
Alert.addToList(getSymbol()+","+getInterval(),"GL Setup",Color.black,Color.blue);
AlertTTriggered = true;
vLastAlert = 1;
}
//}}Action_1 GL
//}}Actions
//END OF PROGRAM
}
Comment