TradersXchange

Trading Indicator Resource Library
 
It is currently 24 Apr 2014, 13:21

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: SuperTrend
PostPosted: 21 Feb 2011, 05:20 
Offline

Joined: 18 Feb 2011, 20:50
Posts: 3
Location: Egypt
For MultiCharts only

Code:
// SuperTrend indicator
// March 25 2010
// Big Mike http://www.bigmiketrading.com
//
// http://www.tradersxchange.com

inputs:
Soundon(false),
look.back(5),
upcol(black),
dncol(red),
ATRLength(9), ATRMult(1), Strength(9);

vars:
intrabarpersist playonce(0),
arw.st(-1),
strend(0),
st(0);

st = SuperTrend(ATRLength, ATRMult, Strength, strend);

//Plot1(st,"Up");
//Plot2(st,"Down");

Plot3(st,"SuperTrend");

if strend = 1 then
SetPlotColor(3, upcol)[1]
else
SetPlotColor(3, dncol)[1];

if strend = 1 then
begin
   //if l[1] = lowest(l, 5)[1] and h > h[1] then
   if l[1] = lowest(l, look.back)[1] and c > medianprice then
   begin
      arw.st = arw_new_s(d, time_s, minlist(l, l[1], st), false);
   
      if soundon and playonce <> currentbar then
      begin
         playonce = currentbar;
         PlaySound("c:\soundfiles\supertrend_up.wav");
      end;
   end;
end
else
begin
   //if h[1] = highest(h, 5)[1] and l < l[1] then
   if h[1] = highest(h, look.back)[1] and c < medianprice then
   begin
      arw.st = arw_new_s(d, time_s, maxlist(h, h[1], st), true);

      if soundon and playonce <> currentbar then
      begin
         playonce = currentbar;
         PlaySound("c:\soundfiles\supertrend_dn.wav");
      end;
   end;
   
end;

arw_setsize(arw.st, 14);
arw_settextsize(arw.st, 14);
arw_settext(arw.st, "St");


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL