Using an index system on another stock

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

Using an index system on another stock

Post by henry1224 »

This is a system that shows when an index is above it's moving average and how it affects another stock

You first have to have the $SPX or the index symbol in the same stock list as the stock you are tracking

under the parameters tab

Sym Symbol $SPX 0 0

pds Double 15 2 200


here is the code


SCl:=Fml(Sym,'C');
x:=MA(SCl,pds);

Entry:If(SCl>=x,1,0),ColorGreen;
Exit:If(SCl<x,-1,0),ColorRed;
FillRgn(Entry == 1,1,0),Brush#70008000;
FillRgn(Exit == -1,0,-1),Brush#70800000;
Post Reply