Percentage Change


New member
Hi all,

Longtime lurker, but stumped on a coding issue. My goal is to set a study alert when a stock's price changes by 0.5%, higher or lower, in a given 1 minute aggregate period. I am combining this with a volume study as well.

I am filtering out the first 15 minutes of the day as well as the last.

My code so far:

Def Active = SecondsFromTime(0945) > 0 and SecondsTillTime(1545) >0;
Plot alert = Active and xxxx

My thought was Plot alert = Active and PercentChg > 0.5(PercentChg,1); but this does not work. I'm very new to this. And I'm almost positive that I'm wrong in that that would only account for a positive percent change in a previous 1 minute, not a negative.

Any help would be greatly appreciated!

Similar threads