[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: TS2000 Pager/email coding



PureBytes Links

Trading Reference Links

Thanks for all who sent replies to my previous message about the
Pager_Send() function.
I am using this with email and not with a pager. However, it should work
fine with an alpha-numeric pager providing that the message is not too long
and you have WinBeep or something installed. You probably do not even need
WinBeep if you have a cell phone that accepts email messages via the
internet.
This functionality is not difficult to use and appears that it will be
useful for my purposes.
The code that is attached simply determines an up trend based upon higher
closes, paints the bar blue and sends out an email to the "Message
Recipient" email address listed in DeskTop Options... | Messaging tab. I set
the buffer size to 512 from the default of 80 characters.
The indicator I'm working on uses multiple data series and intraday data. TS
does not draw multiple data series correctly using intraday data and the
same indicator applied to all data series when they are all on the same
chart. Only data1 can have "Update every tick" checked and the BarStatus
needs to be checked for the other time series to prevent TS from drawing
everything based upon data1's time frame. This quickly creates a confusing
chart in real time.
For EOD or redisplaying of prior intraday data, the check for LastBarOnChart
was added before sending out any email.
email message received looks like this for Friday's OEX:
Indicator applied to symbol:  OEX
Bar TimeStamp: 1615,  Date: 990618
Indicator: 15 Minute Bar is UP.

{
 
----------------------------------------------------------------------------
-

Function: _TestMultiData
		Purpose: Test Multiple Data series on same chart
		Inputs: Avg: average number of bars to determine trend
DataSeries: Dataseries that indicator is applied to (data1 = 1, data2 = 2,
etc.).
	Send_eMail: True = send email to email address in Desktop options.
	False = disable sending of email.
File Name: _TestMultiData.ELS
      Date:	6/20/99 12:23PM
	Author: Roy Johanson
 
----------------------------------------------------------------------------
-

}

Inputs:  Avg(3), DataSeries(1), Send_eMail(False);
If CurrentBar = 1 then
Begin
Vars: value1(0);
Vars: DisplayText(""), TimeStamp(""), rc(False);

End;
If DataSeries < 2 OR (DataSeries >= 2 AND BarStatus(DataSeries) = 2)
then
Begin

TimeStamp = "Indicator applied to symbol:  " + GetSymbolName + NewLine +
"Bar TimeStamp: " + NumToStr(Time, 0) + ",  Date: " + NumToStr(Date, 0) +
NewLine;
value1 = Average(High, Avg)[1];
If Send_eMail AND DataCompression = 1 AND BarStatus(DataSeries) = 2 then
{ send only on finished bar }
Begin
DisplayText = "Indicator: " + NumToStr(BarInterval, 0) + " Minute Bar is
NEUTRAL." + NewLine;
End;

IF Close >= value1 then
Begin
Plot1(High, "HBUY");
Plot2(Low, "LBUY");

If Send_eMail AND DataCompression = 1 AND BarStatus(DataSeries) = 2
then { send only on finished bar }
Begin
DisplayText = "Indicator: " + NumToStr(BarInterval, 0) + " Minute Bar is
UP." + NewLine; { overwrite previous message } End;
End;
If Send_eMail AND DataCompression = 1 AND BarStatus(DataSeries) = 2 then
{ send only on finished bar }
Begin
If LastBarOnChart then { avoid sending pages for previously completed bars }
rc = Pager_Send(Pager_DefaultName, TimeStamp + DisplayText);
End;
End;

 <<_TESTMULTDATA.ELS>>