Not seeing alerts?

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Not seeing alerts?

Postby bowlesj3 » 18 Aug 2021

Hi All,

Is there a way to get alerts to appear during LastBarOnChart during any tick?
I can only get then to appear during the main body of code at BarStatus=2.

I attached a picture of the "Format Study Alert Settings".
I included the code which is executed during LastBarOnChart.
I know the code is working because I hear the play sound and I see the FileAppend info.
I also used the command below to ensure all the charts have the alerts enabled.
I tried getting them to appear both during LastBarOnChart and CurrentBar=1 and neither does it.

Thanks
John

Code: Select all

If AlertEnabled = False then raiseruntimeerror("Alerts turned off");

Code: Select all

if MouseClickDate = 0 or MouseClickTime = 0 then begin Fileappend(LogPath, "Mouse Info Missing: " + " CurrentDate=" + NumToStr(CurrentDate,0) + " CurrentTime=" + NumToStr(CurrentTime,0) + " MouseClickDate=" + NumToStr(MouseClickDate,0) + " MouseClickTime=" + NumToStr(MouseClickTime,0) + NewLine); Playsound("C:\WINDOWS\Media\Chord.wav"); Alert("Error: Mouse Click data missing. See details in " + LogPath); end;
Alert.png
(36.12 KiB) Not downloaded yet

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Not seeing alerts?

Postby bowlesj3 » 18 Aug 2021

For now I am experimenting with putting text on the chart as the code below shows. To get rid of it I turn the study off and on again. Its a pain in that it is a lot of extra work and may block current closing prices not to mention it may extent past the end of the chart and not all be visible.

I may discard this work around and stick with a standard play sound that tells me there will be a FileAppend message in the text file in the downloads directory. Using a different play-sound for each production error is a mistake. It is only good for debugging.

Code: Select all

ErrText_ID(0), {START: Prep the error text} ErrText_ID = Text_New(Date,Time,0,"No Errors."); Text_SetColor(ErrText_ID,Tool_Black); Text_SetStyle(ErrText_ID,0,2);  //0=right 1=left 2=center   2=centered on price {END: Prep the error text} {START: Move the text to a visiable place on the chart and set the text} LeftSideOfScreenDate = JulianToDate(GetAppInfo(aiLeftDispDateTime));     LeftSideOfScreenTime = DateTime2ELTime(GetAppInfo(aiLeftDispDateTime)); value1 = Text_SetLocation(ErrText_ID,LeftSideOfScreenDate,LeftSideOfScreenTime,close); Text_SetColor(ErrText_ID,Tool_Red); Text_SetString(ErrText_ID,"Error: No table entry found for placing the wave number on the chart: see details in " + LogPath); {END: Move the text to a visiable place on the chart and set the text}

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Not seeing alerts?

Postby bowlesj3 » 27 Aug 2021

All of a sudden the alert I put in shows up. It occurred before the market opened when no data is coming in but the following command was creating false ticks.
RecalcLastBarAfter(1); //Code to create a false tick so this code is executed at least every second

So I went to this MC wiki page
https://www.multicharts.com/trading-sof ... ing_Alerts
and extracted this.
A check for the alert triggering conditions is performed whenever one of the following events occurs:

Workspace is opened
Data series (symbol) is replaced with another data series (symbol)
A bar is closed or a new tick is received
I waited until market open and the alert still works. So I guess I will leave myself a reminder to see if I can get it to fail again as it was doing before.


Return to “MultiCharts”