Australian (ASX) Stock Market Forum

Software that will do trendline alerts?

Joined
6 July 2013
Posts
15
Reactions
0
I've been using Metastock for many, many years, and am now looking to switch to a new platform. Is anybody aware of any software (or software with a plug-in) that can do either of the following?

1) Create trendline alerts on a manually drawn trend line (e.g. on a breakout)
2) Reference a manually drawn trend line in a formula (for example if I want to know the price difference between the current close and the current value of a manually drawn trend line.

Thanks!
 
MT4 has some custom indicators such as one called "Magic Stick "which does some if not all of what you want.
Of course you can only trade FX or CFD's on MT4.:2twocents
 
Ah... thanks, I should have said that I am trading equities.. so I'm still open to people's suggestions
 
I've been using Metastock for many, many years, and am now looking to switch to a new platform. Is anybody aware of any software (or software with a plug-in) that can do either of the following?

1) Create trendline alerts on a manually drawn trend line (e.g. on a breakout)
2) Reference a manually drawn trend line in a formula (for example if I want to know the price difference between the current close and the current value of a manually drawn trend line.

Thanks!

Amibroker certainly does the first. Pretty sure it does the second but you might want to check that.

--------------------------------------------------------
Using formula-based alerts
Introduction

AmiBroker allows you to define formula-based alerts. When alert is triggered a text can be displayed, user-defined sound played back, e-mail notification can be sent and any external application can be launched. This is all handled by single AlertIF function.

By default all alerts generate text that is displayed in the Alert Output window.

To show this window you have to select View->Alert Output menu.

There is also Easy Alerts window that allows you to define simple alerts that do not require any coding (but do not offer full flexibility of AlertIf function).

Settings

Alert - related settings are present in the "Alerts" tab of Tools->Preferences window.

It allows to define e-mail account settings, test sound output and define which parts of AmiBroker can generate alerts via AlertIF function.

E-mail setting page now allows to choose among most popular authorization schemes like: AUTH LOGIN (most popular), POP3-before-SMPT (popular), CRAM-MD5, LOGIN PLAIN.

"Enable alerts from" checkboxes allow you to selectively enable/disable alerts generated by Automatic analysis, Commentary/Interpretation and custom indicators.

Alert output window now has an additional column that shows the source of alert - if this is Automatic Analysis, Commentary or one of your custom indicators. This makes it easier to find out which part of AmiBroker generates alerts.

New in AmiBroker 5.30 - support for SSL (secure connection) used by GMail for example.

In order to enable SSL support you need to follow these steps:

1. Download and run SSL add-on from http://www.amibroker.com/bin/SSLAddOn.exe
2. Configure (Tools->Preferences->Alerts) with SSL enabled as shown below



AlertIF function

AlertIF function is similar to WriteIF. But instead of just writing the text to the output window (commentary/interpretation) it allows to:

direct the customized text to "alert output" window,
make a sound (just by computer beeper or from .WAV file)
send an e-mail
launch any external application
The syntax is as follows:

AlertIf( BOOLEAN_EXPRESSION, command, text, type = 0, flags = 1+2+4+8, lookback = 1 );

1. BOOLEAN_EXPRESSION is the expression that if evaluates to True (non zero value) triggers the alert. If it evaluates to False (zero value) no alert is triggered. Please note that only lookback most recent bars are considered.

2. The command string defines the action taken when alert is triggered. If it is empty the alert text is simply displayed in the Alert output window (View->Alert Output). Other supported values of command string are:

SOUND the-path-to-the-WAV-file
EMAIL
EXEC the-path-to-the-file-or-URL <optional args>

SOUND command plays the WAV file once.

EMAIL command sends the e-mail to the account defined in the settings (Tools->Preferences->E-mail). The format of the e-mail is as follows:

Subject: Alert type_name (type) Ticker on Date/Time
Body: text

EXEC command launches external application or file or URL specified after EXEC command. <optional args> are attached after file name and text is attached at the end

3. Text defines the text that will be printed in the output window or sent via e-mail or added as argument to the application specified by EXEC command

4. Type defines type of the alert. Pre-defined types are 0 - default, 1 - buy, 2 - sell, 3 - short, 4- cover. YOu may specify higher values and they will get name "other"

5. Flags control behaviour of AlertIF function. This field is a combination (sum) of the following values:
( 1 - display text in the output window, 2 - make a beep (via computer speaker), 4 - don't display repeated alerts having the same type, 8 - don't display repeated alerts having the same date/time) By default all these options are turned ON.

6. lookback parameter controls how many recent bars are checked

Examples:

Buy = Cross( MACD(), Signal() );
Sell = Cross( Signal(), MACD() );
Short = Sell;
Cover = Buy;

AlertIF( Buy, "EMAIL", "A sample alert on "+FullName(), 1 );

AlertIF( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );

AlertIF( Short, "EXEC Calc.exe", "Launching external application", 3 );

AlertIF( Cover, "", "Simple text alert", 4 );

Note EXEC command uses ShellExecute function and allows not only EXE files but URLs too.

Notes

1. Please note that by default AlertIf function does not generate repetitive signals when the same scan is run multiple times. During experimentation you may prefer to get repeated signals in subsequent scans. To do so you should change default flags to 1 + 2:

AlertIF( condition, "", "Text", 1, 1+2 );

2. If you want to generate the alert only on COMPLETED bar you may need to add this code:

barcomplete = BarIndex() < LastValue(BarIndex());

AlertIF( barcomplete AND condition, "", "Text", 1 );
 
So in practise and referring to post #1 ... If you have drawn an up trend line and name it U1 then the code to show the current distance would be

Code:
up1 = Study( "U1", 1632 ); 
distance = LastValue( Close ) - up1;

Plot(LastValue(distance), "Distance between Current Price and Uptrend Line", colorRed, styleLine);

or


Code:
up1 = Study( "U1", 1632 ); 
distance = C - up1;

Plot(distance, "Distance between Price and Uptrend Line", colorRed, styleLine);

to visualize ticks (FX or Futures) then define ticksize in Information window and in code add

Code:
up1 = Study( "U1", 1632 ); 
distance = (C - up1) / Ticksize;

Plot(distance, "Distance between Price and Uptrend Line", colorRed, styleLine);

etc.

1632 is the chart ID of the upper pane where there is the trendline drawn. To get the info click CTRL+R if the chart is selected. If you use the code in the same pane as the one where the trend line is drawn then you can use GetChartID();

5vpb.png


properties of the trendline to give the line a name like U1 etc.

q78j.png



two codes in action http://img855.imageshack.us/img855/7009/ohp.gif
 
Wow... thanks very much to all of you for the fast replies so far - Amibroker it is then! I've just downloaded a trial version of it, and I've got say, within just 5 minutes of playing around with it, my initial thoughts are "this seems to have a lot more capabilities than Metastock.. and damn, what have been missing out on all this time!"
 
Richard, I just came up with another idea you can play around with and where you don't have to look up the chartid every time.

Just add the following line to the code of the price chart pane where you draw the line

Code:
StaticVarSet( "Up1", Study( "U1", GetChartID() ) );
remember Properties name of the Trendline and name of Study function must be the same. Here it is U1.


and the following code can be applied anywhere (lower pane, different chart tab, different sheet)
Code:
up1 = StaticVarGet( "Up1" );
distance = C - up1; 
Plot(distance, "Distance between Price and Uptrend Line", colorRed, styleLine);

and it will also recognize the value(s) since it has been made global through StaticVarSet.
 
Richard, I just came up with another idea you can play around with and where you don't have to look up the chartid every time.

Just add the following line to the code of the price chart pane where you draw the line

Code:
StaticVarSet( "Up1", Study( "U1", GetChartID() ) );
remember Properties name of the Trendline and name of Study function must be the same. Here it is U1.


and the following code can be applied anywhere (lower pane, different chart tab, different sheet)
Code:
up1 = StaticVarGet( "Up1" );
distance = C - up1; 
Plot(distance, "Distance between Price and Uptrend Line", colorRed, styleLine);

and it will also recognize the value(s) since it has been made global through StaticVarSet.

Trash, I posted a trend line alert indicator on here somewhere that I found browsing around the Internet. Maybe you could find it in one of the amibroker threads....I'm just away with infrequent Internet....

The code had an alert when the price broke the trendline.

CanOz
 
Trash, I posted a trend line alert indicator on here somewhere that I found browsing around the Internet. Maybe you could find it in one of the amibroker threads....I'm just away with infrequent Internet....

The code had an alert when the price broke the trendline.

CanOz


Thanks for info! Well, personally I don't need it because I don't use trend lines.
But if i.e. Richard wants to search for it there are many examples here and there.
 
Trash, I posted a trend line alert indicator on here somewhere that I found browsing around the Internet. Maybe you could find it in one of the amibroker threads....I'm just away with infrequent Internet....

The code had an alert when the price broke the trendline.

CanOz


Thanks for all the formulas.. I need to get up to speed with Amibrokers formula language.. my brain is still firmly in Metatock language... and this is why I hate changing software!! :)
 
Thanks for all the formulas.. I need to get up to speed with Amibrokers formula language.. my brain is still firmly in Metatock language... and this is why I hate changing software!! :)


Richard, there are some similarities between MetaStock Formula Language and AFL. So the change shouldn't be that difficult. But of course AFL is more powerful. Besides that you can also use C/C++/.Net since there are SDKs available.

I have uploaded some AFL examples here https://www.aussiestockforums.com/f...t=1679&page=92&p=782778&viewfull=1#post782778 were Tomasz Janeczko, the AmiBroker developer, explains the difference between Metastock's Prev function and how to better do it in AFL. Open the AFLs in the AmiBroker editor and read the content if you like. It also contains the links to the AB forum where it was discussed. I think it is a good introduction.
 
Thanks for the links - I had been looking for a good starting place.

Another quick question if you don't mind :) .... I managed to produce a relative performance chart using a handful of stocks.. and at the top of the resulting chart it showed a strip of data showing the stock symbols included in the the chart (i.e. the ones I was comparing).. do you know if its possible for AB to show the stock names rather than the symbols?
 
Thanks for the links - I had been looking for a good starting place.

Another quick question if you don't mind :) .... I managed to produce a relative performance chart using a handful of stocks.. and at the top of the resulting chart it showed a strip of data showing the stock symbols included in the the chart (i.e. the ones I was comparing).. do you know if its possible for AB to show the stock names rather than the symbols?

Sure. There is nearly nothing that is not possible. I have added it to this thread https://www.aussiestockforums.com/f...t=1679&page=92&p=782883&viewfull=1#post782883
For further questions better go to that main AB thread.
 
Top