[amibroker] Re: Required mail alert option code for buy,sell short and cover

 

This is what I use. It is a function I call. You need to use a static variable so you only send the alert once if the alert is sent from an auto trading program or if the program is run with every tick that arrives.


text is the data you want to send in the email and I use StrFormat to format the text.
or you can do something like this

Text = "Buy " + Name() + strformat(" Contracts = %g Price = %g", contracts, price);
 
This is sent from an auto trading program. Without the static var it will send an alert every time a new tick comes in. 

function fSendAlertOnce( text ) 

   if( SendAlert AND StaticVarGetText("LastAlertSent") != text ) 
   { 
  AlertIf(True, "EMAIL", Date() +  ", " + text, type = 0 );
      StaticVarSetText(VarPfx + "LastAlertSent", text ); 
   } 


__._,_.___

Posted by: razzbarry@imageview.us
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon