Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Platforms and Indicators > TradeStation > EasyLanguage Programming


Notices
     

EasyLanguage SuperTrend indicator
Started:March 25th, 2010 (03:01 AM) by Big Mike Views / Replies:31,520 / 75
Last Reply:September 17th, 2013 (10:42 AM) Attachments:9

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

This forum was established to help traders by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

BMT is fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike
     

Reply
 9  
 
Thread Tools Search this Thread

EasyLanguage SuperTrend indicator

Old November 5th, 2011, 06:15 AM   #41 (permalink)
Elite Member
NJ
 
Trading Experience: Beginner
Platform: NinjaTrader
 
Posts: 7 since May 2010
Thanks: 2 given, 18 received

Hi cedar,

That's a nice modification of the code. Or, you can set style to point (see pic below).

Can you explain what signal you use or find useful? I tried strategies mainly use superTrend for entry.
Just as you said, it catches the major trend, but also a lot false entries. It could not be used in real trading at this point.

Thanks.

Attached Thumbnails
EasyLanguage SuperTrend indicator-supertrend.png  
Reply With Quote
     

Old November 5th, 2011, 11:12 AM   #42 (permalink)
Trading Apprentice
New York
 
Trading Experience: Advanced
Platform: TradeStation
Favorite Instrument: ES
 
Posts: 44 since May 2011
Thanks: 12 given, 25 received


chtangwin View Post

Can you explain what signal you use or find useful? I tried strategies mainly use superTrend for entry.
Just as you said, it catches the major trend, but also a lot false entries. It could not be used in real trading at this point.

good to hear from you chtangwin.

What I find useful, is once the 'Trend' is identified by superTrend. Then use an oscillator(CCI, Stochastic, %R etc) to take trades in the direction of the trend. So essentially we are buying/selling pullbacks in the direction of the trend.

As a quick exmaple, in the attachement below, I put on a 12 period CCI.

As you know it takes rigorous testing to take a strategy from an idea to production. very few things pan out. I find using wide stops and proper profit targets, help quite a bit for intraday trading.

Attached Thumbnails
EasyLanguage SuperTrend indicator-nov-5.bmp  
Reply With Quote
     

Old November 6th, 2011, 06:15 PM   #43 (permalink)
Elite Member
NJ
 
Trading Experience: Beginner
Platform: NinjaTrader
 
Posts: 7 since May 2010
Thanks: 2 given, 18 received


Thanks a lot! Initial test shows a downward equity curve though, will look more into it.

Reply With Quote
     

Old January 25th, 2012, 02:01 PM   #44 (permalink)
Elite Member
San Diego CA, USA
 
Trading Experience: Beginner
Platform: TradeStation
Favorite Instrument: YM
 
Posts: 22 since Jan 2012
Thanks: 12 given, 5 received

Hi All,

My first post here. What a great place! I loaded the TCanasupertrend with the mod and switched the line to dots. I would like to change it to be just one row of dots in a flat line at the bottom or top of the charts so it doesnt muck up the view of price action. Anyone care to share how to add that in the EL code.

Thanks so much for all your efforts here.

Eiji


cedar View Post
While one will go broke taking every signal, I find the various forms of superTrend are great as a trend 'filter'. Can be easily used in strategies.

So once Trend is identified, take signals(some other method) in the direction of SuperTrend.

A slight modification to the anaSuperTrend code. The following will generate just one line and switch colors.

 
Code
 
{if currentUpTrend = true  then begin
 plot1(stopDot, "UpStopDot");
end;
if currentUpTrend = false then begin
 plot2(stopDot, "DnStopDot");
end;}
 
Plot1(stopDot);
 
If close > stopDot Then 
SetPlotColor(1,Green)else 
  SetPlotColor(1,magenta);


Reply With Quote
     

Old January 26th, 2012, 12:33 AM   #45 (permalink)
Aspiring retail quant
The Netherlands
 
Trading Experience: None
Platform: MultiCharts .NET, R/RStudio
Broker/Data: LMAX, InteractiveBrokers/IQFeed
Favorite Instrument: Exchange-traded derivates
 
Posts: 602 since Apr 2010
Thanks: 2,230 given, 510 received


Eiji View Post
I loaded the TCanasupertrend with the mod and switched the line to dots. I would like to change it to be just one row of dots in a flat line at the bottom or top of the charts so it doesnt muck up the view of price action. Anyone care to share how to add that in the EL code.

Where can we find the code for the TCanasupertrend indicator? (I couldn't find it here on BMT) And what does 'with the mod' mean?

It would be hard to change the EasyLanguage code to what you want without something to start with.

Reply With Quote
     

Old January 26th, 2012, 01:06 AM   #46 (permalink)
Elite Member
San Diego CA, USA
 
Trading Experience: Beginner
Platform: TradeStation
Favorite Instrument: YM
 
Posts: 22 since Jan 2012
Thanks: 12 given, 5 received

Jura,
here is the code for the TCanaSupertrend

inputs:
PeriodMedian(3),
PeriodATR(3),
Multiplier(2);

variables:
priceMedian(0),
upTrend(true),
priorUpTrend(true),
currentUpTrend(true),
stopDot(0),
priorStop(0),
newStop(0),
offset(0);

priceMedian = 0.5 * (high + low);
if currentbar = 1 then begin
upTrend = true;
stopDot = close;
end
else begin
// FirstTickOfBar
priorUpTrend = upTrend[1];
priorStop = stopDot[1];
offset = AvgTrueRange(periodATR)[1];

if close > priorStop then begin
upTrend = true;
currentUpTrend = true;
newStop = _TC_anaMovingMedian(priceMedian, periodMedian) - multiplier * offset;
if priorUpTrend = false then
stopDot = newStop
else
stopDot = maxlist(newStop, priorStop);
end
else if close < priorStop then begin
upTrend = false;
currentUpTrend = false;
newStop = _TC_anaMovingMedian(priceMedian, periodMedian) + multiplier * offset;
if priorUpTrend = true then
stopDot = newStop
else
stopDot = minlist(newStop, priorStop);
end
else begin
upTrend = priorUpTrend;
currentUpTrend = priorUpTrend;
stopDot = priorStop;
end;
end;



{if currentUpTrend = true then begin
plot1(stopDot, "UpStopDot");
end;
if currentUpTrend = false then begin
plot2(stopDot, "DnStopDot");
end;}

Plot1(stopDot);

If close > stopDot Then
SetPlotColor(1,Green)else
SetPlotColor(1,red);



I would love just a single row of dots instead of it being plotted above and below the price action. Any help would be greatly appreciated.

Reply With Quote
     
The following user says Thank You to Eiji for this post:
     

Old January 26th, 2012, 01:11 AM   #47 (permalink)
Aspiring retail quant
The Netherlands
 
Trading Experience: None
Platform: MultiCharts .NET, R/RStudio
Broker/Data: LMAX, InteractiveBrokers/IQFeed
Favorite Instrument: Exchange-traded derivates
 
Posts: 602 since Apr 2010
Thanks: 2,230 given, 510 received


Eiji View Post
here is the code for the TCanaSupertrend

(...)

Hi Eiji,

Your code uses a function called _TC_anaMovingMedian, for example here:

 
Code
newStop = _TC_anaMovingMedian(priceMedian, periodMedian) + multiplier * offset;
What's the code for this function? Or do you want to substitute that for something else?

Tip: add the pasted code between [ code ] and [ / code ] tags for better formatting (the # in the text box).

Reply With Quote
     

Old January 26th, 2012, 01:37 AM   #48 (permalink)
Elite Member
San Diego CA, USA
 
Trading Experience: Beginner
Platform: TradeStation
Favorite Instrument: YM
 
Posts: 22 since Jan 2012
Thanks: 12 given, 5 received

Jura,


Thanks for replying, Im not sure what you are asking. I grabbed the code from an earlier post on this thread and added the modification from another post. the code plots a line changing color from red to green , above and below price action on the chart. I like the signals and in the least it is a great filter, but do not like that it obscures the view and busies up the screen.
Im not a programmer but have figured out how to paste copied text into the EL development to create the file and get it to work. Other than that Im just guessing.

Reply With Quote
     

Old January 27th, 2012, 08:17 PM   #49 (permalink)
Elite Member
San Diego CA, USA
 
Trading Experience: Beginner
Platform: TradeStation
Favorite Instrument: YM
 
Posts: 22 since Jan 2012
Thanks: 12 given, 5 received

Anyone?

Reply With Quote
     

Old January 28th, 2012, 12:25 AM   #50 (permalink)
Aspiring retail quant
The Netherlands
 
Trading Experience: None
Platform: MultiCharts .NET, R/RStudio
Broker/Data: LMAX, InteractiveBrokers/IQFeed
Favorite Instrument: Exchange-traded derivates
 
Posts: 602 since Apr 2010
Thanks: 2,230 given, 510 received



Eiji View Post
Anyone?

What I'd do is set the indicator to a separate panel (so not 'Same as Symbol' as found in the properties of the indicator), then change the lines from 'Line' to 'Histogram', give these a fixed value (like 10), and change the width so you'll have tick Histogram bars. Lastly, use SetPlotColor() to change the color of the Histogram plot depending on what your definition of 'bulish/uptrend' versus 'bearish/downtrend' is. Then you'll have a separate panel below your chart which shows you the trend/direction, without messing up the price.

Since I can't get the indicator to work here without the function, you'll probably have to do this for yourself.

Reply With Quote
     
The following user says Thank You to Jura for this post:
     

Reply



Tags
%r, ai, algorithm, amp, anasupertrend, atr, ats, automated, bars, big mike, brokers, buy sell, change, chart, charts, cl, close, code, color, colors, combine, compile, control, create, day, development, direction, dow, easy language, easylanguage, el, eld, ema, entry, equity curve, error, es, fastbrokers, favourite, file, fill, flag, format, free, function, functions, future, high, hma, hull, import, index, india, indicator, indicators, instrument, jurik, language, line, load, lot, love, low, market, mind, ml, modify, moving average, multicharts, neoticker, newbie, ninja, note, oec, onstartup, order, period, plot, price, price_action, profit, programming, prorealtime, pullbacks, purpose, puts, question, reverse, script, settings, setup, signal, signals, start, stop, strategies, strategy, strength, supertrend, targets, testing, thank you, thinkscript, tick, time, trader, trades, tradestation, trading, trend, trend following, trend line, txt, update, var
     

Big Mike's Trading Forum > Trading Forums > Platforms and Indicators > TradeStation > EasyLanguage Programming > EasyLanguage SuperTrend indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyLanguage ADXVMA Indicator Big Mike EasyLanguage Programming 12 June 5th, 2012 05:10 PM
Error with recoded Supertrend Line for EasyLanguage DarrenH EasyLanguage Programming 3 February 5th, 2011 12:05 PM
NinjaTrader indicator SuperTrend + audio alerts ojwright NinjaTrader 6 July 29th, 2010 01:54 AM
EasyLanguage ZeroLagEMA indicator Big Mike EasyLanguage Programming 1 April 10th, 2010 01:16 PM
EasyLanguage ZeroLagWMA indicator Big Mike EasyLanguage Programming 1 April 10th, 2010 01:09 PM


All times are GMT -4. The time now is 11:26 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
 
no new posts

Page generated 2014-04-17 in 0.27 seconds with 20 queries on phoenix via your IP 54.243.14.193