logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
u978  
#1 Posted : Tuesday, September 24, 2013 8:49:49 AM(UTC)
u978

Rank: Newbie

Groups: Registered, Registered Users
Joined: 9/24/2013(UTC)
Posts: 1

hi,

could someone explain what the below code does:

Alert(vtr >= Ref(vtr,-1),2);

this is part of this line:

SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000)) AND Alert(vtr>=Ref(vtr,-1),2), vc, If(haC<(Ref(haC,-1)*(1-cutoff/1000)) AND Alert(vtr>Ref(vtr,-1),2),-vc,0)),period)/(vave+1),period);

just trying to understand how the averaging works.

any help will be greatly appreciated.

many thanks

John S  
#2 Posted : Wednesday, October 16, 2013 3:29:32 PM(UTC)
John S

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/9/2012(UTC)
Posts: 169

Here's what the Help file says about the Alert() function:

SYNTAX

alert( EXPRESSION, PERIODS )

FUNCTION

Extends a "true" result of EXPRESSION for the specified number of periods. This true result is held true over the number of periods specified even if a "false" result is generated.

EXAMPLE

alert( cross(rsi(14),70),5 )


So your expression, "vtr >= Ref(vtr,-1)" is being extended in a true state for two periods. So the day it goes false, it will stay true another two bars past that point.

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.