Qscript for Email Alert for Exhaustion Bars and 59 patterns

Have a QScript to share, or need help with programming? Post your comment here.
Post Reply
kiasucapital
Posts: 7
Joined: Sat Jan 06, 2024 8:43 am
Contact:

Qscript for Email Alert for Exhaustion Bars and 59 patterns

Post by kiasucapital » Thu Jan 18, 2024 1:32 am

Hi I've searched the library but couldn't find anything. I was just wondering if anybody has a qscript to set up alerts for Exhaustion Bars and 59 patterns? Or could give me a clue on how to program this?

Cheers

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: Qscript for Email Alert for Exhaustion Bars and 59 patterns

Post by sbank » Thu Jan 18, 2024 1:45 pm

Here's some simple code on one of the exhaustion bars types:

Code: Select all

#initialize variables
if (barnum==barsback) { 
   bs = 0;
}

#Exbars 1
exb1=ExBars1(6,30);
if (exb1==1) {
  signal1=1;
}                      
if (exb1==-1) {
  signal1=-1;
}   

# go long   
if ((signal = 1) and (bs <= 0)) {
   buy(1,close,"market","onebar");
   SendEmail("email_address", "email_address", "Message From Wave59", "Just went long on CL");
   bs = 1;
}   
Alternatively, if you do not want an e-mail, you can replace that line with something like:

Code: Select all

alert("Just went long CL","");
I use "bs" (buy/sell) as a simple variable to track if we are in an order or not. This is a convention that I picked up from Earik. You can also use the builtin variable marketposition.
  • The first chunk of code initialized bs to zero.
  • The second chunk of code just gets the values from the exhaustion bar function. (You can replace this with the other exhaustion bar function, or 95count, etc.)
  • The third chunk of code says "if we are long, and we are not in a position (bs==0) or we are not short (bs<0), then buy 1 contract, send some mail (or alert), and set bs to 1 so on the next bar it does not trigger again.)
-Steven

kiasucapital
Posts: 7
Joined: Sat Jan 06, 2024 8:43 am
Contact:

Re: Qscript for Email Alert for Exhaustion Bars and 59 patterns

Post by kiasucapital » Fri Jan 19, 2024 3:26 am

Awesome Steve! Thanks so much you have been incredibly helpful.

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: Qscript for Email Alert for Exhaustion Bars and 59 patterns

Post by sbank » Fri Jan 19, 2024 1:37 pm

Glad this was of use!

If you really want to get into QScript writing, there is the help file (which is very useful), but more importantly, just look at the indicators and functions that release with Wave59. Some of the stuff can get quite advanced, but I have learned a lot by perusing what Earik and others have done.

(Don't forget about the QScript library at: http://www.wave59.com/library/default.asp
Lots of neat stuff in there. :D

Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests