Help with code on alert

Questions about MultiCharts and user contributed studies.
aczk
Posts: 71
Joined: 08 Feb 2012
Has thanked: 8 times
Been thanked: 1 time

Help with code on alert

Postby aczk » 14 Mar 2014

Hi All

Just want to get a message when X contracts are traded, added some lines to the volume indicators', but nothing happens????

Code: Select all

if BarType >= 2 and BarType < 5 then
Plot1( Volume, "Volume" )
else
Plot1( Ticks, "Volume" ) ;


if BarType >= 2 and BarType < 5 then

if volume >= 1300 then alert
else

if volume >= 1300 then alert;
Appreciate any help on this

thx

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Help with code on alert

Postby JoshM » 14 Mar 2014

Two things that I can quickly think of:

* Have you enabled the alerts for the indicator/strategy in question?

* Shouldn't your second if/else statement differentiate between `volume` and `ticks`, just like the first if/else statement? If you write it like you have done now, the second if/else statement is not needed and you can just add `if volume >= 1300 then alert;`.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Help with code on alert

Postby Andrew MultiCharts » 14 Mar 2014

Hello aczk,

Make sure the alerts are configured and enabled in indicator's settings.


Return to “MultiCharts”