Alert on daily open


0
0

Hello

Please have a look at the Script and help me to add alert on when it crossover daily open currently script alert me on premarket high but I want to have alerted when it cross daily open attach is the script.

 

 

 

 

Attachments:
Marked as spam
Posted by (Questions: 6, Answers: 3)
Asked on June 20, 2018 7:13 pm
75 views

There is no need to use the custom study you attached. That is overkill for what you are requesting. I just need to know if you are requesting a Chart Study that alerts for the ticker symbol loaded on the chart, or if you are asking for a Scan that alerts for a group of ticker symbols.

( at June 21, 2018 7:40 am)

Last reminder. Still waiting for you to provide additional details as requested above. If no response in 24 hours this post will be deleted.

( at June 27, 2018 8:38 am)

actually i am looking for both i need chart alert whenever the current price crossover to daily open ( RED TO GREEN)

Thanks for all your help

( at June 27, 2018 8:39 pm)
0
Private answer

Here is the code for the chart study:

def newDay = GetDay() <> GetDay()[1];
rec priceOpen = if newDay then open else priceOpen[1];
plot dailyOpen = priceOpen;
plot crossAboveOpen = !newDay and close[1] < dailyOpen[1] and close > dailyOpen;
crossAboveOpen.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
crossAboveOpen.SetDefaultColor(Color.CYAN);
crossAboveOpen.SetLineWeight(3);
Alert(crossAboveOpen, "Cross Above Open", Alert.BAR, Sound.RING);

Here is the code for the scan:

def newDay = GetDay() <> GetDay()[1];
rec priceOpen = if newDay then open else priceOpen[1];
def crossAboveOpen = !newDay and close[1] < priceOpen[1] and close > priceOpen;
plot scan = crossAboveOpen;

Screenshot below shows what the chart study looks like with arrows. Audible alerts will trigger at those arrows. Arrows can repaint of the close of the bar moves back below the daily open.

Attachments:
Marked as spam
Posted by (Questions: 35, Answers: 1789)
Answered on June 28, 2018 7:57 am

Thanks for the script but is it possible to exclude pre market hours.

( at June 28, 2018 11:57 am)

Yes, you exclude premarket hours by changing the chart settings and scan settings to not include them.

( at June 28, 2018 12:09 pm)