TL Alert: How to set the audio via code

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

TL Alert: How to set the audio via code

Postby arjfca » 24 May 2017

Hello

I can set an alert on a trend line via the code . Can I select the audio WAV file to be played if the alert is triggered? I could code it the hard way by seeing if a price triggered a target and act upon it, but since I could modify directly the type of alert conditions, I suppose that I could also select the audio file

Martin

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: TL Alert: How to set the audio via code

Postby Angelina MultiСharts » 25 May 2017

Hello arjfca,

Alert sounds can only be specified in Format Study -> Alerts tab.
But you can use the PlaySound keyword.
Strictly speaking, it's not an alert but it does the trick: it can play the specified audio file when the condition is met.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: TL Alert: How to set the audio via code

Postby arjfca » 25 May 2017

Hello arjfca,

Alert sounds can only be specified in Format Study -> Alerts tab.
But you can use the PlaySound keyword.
Strictly speaking, it's not an alert but it does the trick: it can play the specified audio file when the condition is met.
Hello Angelina

I'm already using it. The goal was to select via the code the given message to be sent.
Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: TL Alert: How to set the audio via code

Postby TJ » 25 May 2017

@Angellina:


What Martin proposing is to add one more parameter to the keyword.

eg.

TL_SetAlert ( TL_ID , AlertStatus , "PathFilename" )

Where

PathFilename - a string expression specifying the path and filename of the wave file to be played.

example:

Value1 = TL_SetAlert ( 3 , 2 , "C:\ding.wav" ) ;

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: TL Alert: How to set the audio via code

Postby Angelina MultiСharts » 31 May 2017

Thanks TJ.

Martin, can you please submit a feature request and post a link here?


Return to “MultiCharts”