EasyLanguage SuperTrend indicator - EasyLanguage Programming | futures io social trading
futures io futures trading


EasyLanguage SuperTrend indicator
Updated: Views / Replies:52,783 / 79
Created: by Big Mike Attachments:9

Welcome to futures io.

Welcome, Guest!

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

We are 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

  #31 (permalink)
Elite Member
Stockholm
 
Futures Experience: Intermediate
Platform: Nanotrader/ tradestaion
Broker/Data: WHS / TS
Favorite Futures: EC / SI / ES / BP
 
Posts: 19 since Mar 2011
Thanks: 8 given, 5 received

indicator or Strategy

Hello, is this the EL for the indicator or the strategy?
I see 2 diffrent, do they belong together or are they 2 separate indicators or strategy's?

Lamboo

Reply With Quote
 
  #32 (permalink)
Elite Member
NJ
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 7 since May 2010
Thanks: 2 given, 21 received

Hi Lamboo,

1st one is indicator code, 2nd one is for _anaMovingMedian function used by the indicator.
All you need is copy and paste the code in EasyLanguage Editor (File -> New).

Hope this helps.

Reply With Quote
 
  #33 (permalink)
Elite Member
Quebec
 
Futures Experience: Intermediate
Platform: Multicharts 64 +VolProfile
Broker/Data: AMP Trading / CQG
Favorite Futures: Ym, Es
 
Serger's Avatar
 
Posts: 72 since Oct 2010
Thanks: 64 given, 22 received


Changwin,
I import, compile code and indic .. but one problem ..
I have make :subgraph1 ...same as instrument but just one red line at 0.001
Have you one idea why?
Thank you

Attached Thumbnails
EasyLanguage SuperTrend indicator-anasupertrendm1.png  
Reply With Quote
 
  #34 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 45,899 since Jun 2009
Thanks: 29,116 given, 81,750 received


chtangwin View Post
Thanks Mike. futures.io (formerly BMT) is the greatest forum I ever know. Certainly glad I can contribute. I am new to EL and trading. Having programming background, writing code is easy, but learning trading is hard.

Feel free to let me know if there is any programming need, could be a good exercise for me.

Please check here for requests:
https://futures.io/elite-circle/11130-want-your-easylanguage-indicator-created-free.html

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #35 (permalink)
Trading Apprentice
New York
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: ES
 
Posts: 44 since May 2011
Thanks: 12 given, 28 received


chtangwin View Post
I converted the anaSuperTrendM1 indicator (also from futures.io (formerly BMT)) to Easy Language.

Please let me know if any issues.

Function: _anaMovingMedian

 
Code
Inputs:
    PriceValue( numericseries ), 
    Period(NumericSimple);
 
variables:
    medianIndex(0),
    priorIndex(0),
    even(false),
    sPeriod(0),
    idx(0),
    val(0),
    initialized(false);
 
array:
    mArray[](0);
 
{ OnStartUp }    
if initialized = false then begin
    initialized = true;
    array_setmaxindex(mArray, Period);
    fill_array(mArray, 0.0);
    if mod(Period, 2) = 0 then begin
        even = true;
        medianIndex = floor(Period/2);
        priorIndex = medianIndex - 1;
    end
    else begin
        even = false;
        medianIndex = floor((Period - 1)/2);
    end;
end;
 
{ OnUpdate }
if currentbar < Period then begin
    sPeriod = currentbar;
    for idx = 1 to sPeriod begin
        mArray[idx] = PriceValue[idx-1];
    end;
    array_sort(mArray, 1, sPeriod, true);
    if mod(sPeriod, 2) = 0 then begin
        idx = floor(sPeriod/2);
        val = 0.5 * (mArray[Period - idx] + mArray[Period - idx + 1]);
    end
    else begin
        idx = floor((1 + sPeriod)/2);
        val = mArray[Period - idx + 1];
    end;
end
else begin
    for idx = 1 to Period begin
        mArray[idx] = PriceValue[idx-1];
    end;
    array_sort(mArray, 1, Period, true);
    if even then
        val = 0.5 * (mArray[medianIndex] + mArray[priorIndex])
    else
        val = mArray[medianIndex];
end;
 
_anaMovingMedian = val;

hello, getting an error that fill_array is not defined in the function. Thanks

{ OnStartUp }
if initialized = false then begin
initialized = true;
array_setmaxindex(mArray, Period);
fill_array(mArray, 0.0);
if mod(Period, 2) = 0 then begin
even = true;

Reply With Quote
The following user says Thank You to cedar for this post:
 
  #36 (permalink)
Elite Member
Quebec
 
Futures Experience: Intermediate
Platform: Multicharts 64 +VolProfile
Broker/Data: AMP Trading / CQG
Favorite Futures: Ym, Es
 
Serger's Avatar
 
Posts: 72 since Oct 2010
Thanks: 64 given, 22 received

and Work fine ,,
Thank you so much !!

Reply With Quote
 
  #37 (permalink)
Elite Member
NJ
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 7 since May 2010
Thanks: 2 given, 21 received

TS file attached. Some minor changes to MC code below.

 
Code
inputs:
	PriceValue(NumericSeries), 
	Period(NumericSimple);

variables:
	medianIndex(0),
	priorIndex(0),
	even(true),
	sPeriod(0),
	idx(0),
	val(0),
	initialized(false);
	
array:
	mArray[](0);

{ OnStartUp }	
if initialized = false then begin
	initialized = true;
	array_setmaxindex(mArray, Period);
	fill_array(mArray, 0.0);
	if mod(Period, 2) = 0 then begin
		even = true;
		medianIndex = floor(Period/2);
		priorIndex = medianIndex - 1;
	end
	else begin
		even = false;
		medianIndex = floor((Period - 1)/2);
	end;
end;

{ OnUpdate }
if currentbar <= Period then begin
	sPeriod = currentbar;
	for idx = 1 to sPeriod begin
		mArray[idx] = PriceValue[idx-1];
	end;
	array_sort(mArray, 1, sPeriod, true);
	if mod(sPeriod, 2) <> 0 then begin
		idx = floor(sPeriod/2);
		val = 0.5 * (mArray[Period - idx] + mArray[Period - idx + 1]);
	end
	else begin
		idx = sPeriod/2;
		val = mArray[Period - idx];
	end;
end
else begin
	for idx = 1 to Period begin
		mArray[idx] = PriceValue[idx-1];
	end;
	array_sort(mArray, 1, Period, true);
	if even then
		val = 0.5 * (mArray[medianIndex] + mArray[priorIndex])
	else
		val = mArray[medianIndex];
end;

_anaMovingMedian = val;

Attached Files
Register to download File Type: eld ANASUPERTREND.ELD (12.2 KB, 389 views)
Reply With Quote
The following 13 users say Thank You to chtangwin for this post:
 
  #38 (permalink)
Elite Member
Stockholm
 
Futures Experience: Intermediate
Platform: Nanotrader/ tradestaion
Broker/Data: WHS / TS
Favorite Futures: EC / SI / ES / BP
 
Posts: 19 since Mar 2011
Thanks: 8 given, 5 received

Thank you so much!!!!

Reply With Quote
 
  #39 (permalink)
Trading Apprentice
New York
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: ES
 
Posts: 44 since May 2011
Thanks: 12 given, 28 received


chtangwin View Post
TS file attached.

thank you chtangwin, I appreciate you taking the time to do this.

Reply With Quote
 
  #40 (permalink)
Trading Apprentice
New York
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: ES
 
Posts: 44 since May 2011
Thanks: 12 given, 28 received


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);

Attached Thumbnails
EasyLanguage SuperTrend indicator-nov-4.bmp  
Reply With Quote
The following 2 users say Thank You to cedar for this post:

Reply



futures io > > > > > EasyLanguage SuperTrend indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

FIO Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

May

An overview of volumetric analytical tools w/Sergey Sokolov @ PTMC

Elite only

John Hoagland (TBA)

Elite only

FuturesTrader71 Extended Ask Me Anything (AMA)

Elite only

Pete @ Jigsaw Trading (TBA)

Elite only

John @ No BS Day Trading (TBA)

Elite only

An Afternoon with FIO member Softsoap (being rescheduled)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyLanguage ADXVMA Indicator Big Mike EasyLanguage Programming 15 October 29th, 2014 09:51 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:31 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-05-29 in 0.12 seconds with 20 queries on phoenix via your IP 107.22.106.136