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


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

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 9  
 
Thread Tools Search this Thread
 

EasyLanguage SuperTrend indicator

  #61 (permalink)
Trading Apprentice
London
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Forex
 
Posts: 14 since Jan 2013
Thanks: 0 given, 3 received


Big Mike View Post
Gotcha.

The strend var is the key if i remember, monitor it for a change = if I remember it is 1 for long, -1 for short, so you could do something like:

if strend = 1 and strend[1] <> 1 then buy 1 contract next bar at market;

Mike

Mike - just adding my thanks to this old thread - I was able to get a Supertrend function up and running in MC with this post. It's my favourite indicator from a prorealtime past so v grateful for this.

Reply With Quote
 
  #62 (permalink)
Trading Apprentice
Frankfurt / Germany
 
Futures Experience: Intermediate
Platform: NT, MC
Favorite Futures: Stocks, Futures
 
sagetrade's Avatar
 
Posts: 47 since Jul 2013
Thanks: 28 given, 10 received


Big Mike View Post
Gotcha.

The strend var is the key if i remember, monitor it for a change = if I remember it is 1 for long, -1 for short, so you could do something like:

if strend = 1 and strend[1] <> 1 then buy 1 contract next bar at market;

Mike

I cannot replicate this unfortunately. The Signal does not open Positions.


Quoting 
Inputs:

smalength ( 200 ),
emalength ( 50 ),
ATRLength ( 30 ),
ATRMult ( 10 ),
Strength ( 30 ),

Variables:

smav ( 0 ),
emav ( 0 ),
vSuperTrend ( 0 ),
strend ( 0 );

// Call MAs
smav = Average(Close, smalength);
emav = XAverage(Close, emalength);

// Call Supertrend
vSuperTrend = SuperTrend(ATRLength, ATRMult, Strength, vSTrend);

// Open new positions (Long Only)

if marketposition = 0 then begin // Only open new positions if flat

if close > vSuperTrend then begin // Checks if Supertrend is below price action

end;

// EMA and SMA Both Rising & Supertrend switches from Red to Green
if smav > smav[1] and emav > emav[1] and emav > smav
and sTrend = 1 and sTrend[1] <> 1 then begin

Buy ("Enter Long") 1 Contracts Next Bar At Market;

end;

end;


Reply With Quote
 
  #63 (permalink)
Trading Apprentice
Frankfurt / Germany
 
Futures Experience: Intermediate
Platform: NT, MC
Favorite Futures: Stocks, Futures
 
sagetrade's Avatar
 
Posts: 47 since Jul 2013
Thanks: 28 given, 10 received


Anyone help for this?

Reply With Quote
 
  #64 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,410 since Apr 2013
Thanks: 220 given, 801 received
Forum Reputation: Legendary

The variable strend is never assigned a value, except the initial 0.
So your condition
 
Code
sTrend = 1 and sTrend[1] <> 1
can never become true.

Should it be
 
Code
vsTrend = 1 and vsTrend[1] <> 1
?

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #65 (permalink)
Trading Apprentice
Frankfurt / Germany
 
Futures Experience: Intermediate
Platform: NT, MC
Favorite Futures: Stocks, Futures
 
sagetrade's Avatar
 
Posts: 47 since Jul 2013
Thanks: 28 given, 10 received

Hi ABC,

I referred to BigMike's post #22 on Page 3.

I would like to code a Buy/Sell signal for Supertrend crossings.

In Ninjatrader I did it through the following:


Quoting 
// Condition set 1
if (anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[1] > Close[1]
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[0] < Close[0])
{
EnterLong(RiskSize, "Buy Long");
}

// Condition set 2
if (Position.Quantity > 0
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[1] < Close[1]
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[0] > Close[0])
{
ExitLong("Exit Long", "");
}

It works fine, but for Easy Language, I somehow don't get it

Reply With Quote
 
  #66 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,410 since Apr 2013
Thanks: 220 given, 801 received
Forum Reputation: Legendary

Hi sagetrade,

to check for a crossing is quite easy in EasyLanguage.
For an upcross you can do it like this:
 
Code
if MyVariable crosses over MyVariable[1]
or like this:
 
Code
if MyVariable > MyVariable[1] and MyVariable[1] < MyVariable[2]
or
 
Code
if MyVariable > MyVariable[1] and MyVariable[1] <= MyVariable[2]
depending on what you want.

For your code it makes a difference on the variable you want to use. Both sTrend and vSuperTrend are able to accomplish the task.
If you want to use vSuperTrend, then check for the cross. With sTrend you simply need to check for
 
Code
if sTrend = 1 and sTrend[1] = -1
Regards,
ABCTG


sagetrade View Post
Hi ABC,

I referred to BigMike's post #22 on Page 3.

I would like to code a Buy/Sell signal for Supertrend crossings.

In Ninjatrader I did it through the following:



It works fine, but for Easy Language, I somehow don't get it


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #67 (permalink)
Trading Apprentice
Frankfurt / Germany
 
Futures Experience: Intermediate
Platform: NT, MC
Favorite Futures: Stocks, Futures
 
sagetrade's Avatar
 
Posts: 47 since Jul 2013
Thanks: 28 given, 10 received


ABCTG View Post
For your code it makes a difference on the variable you want to use. Both sTrend and vSuperTrend are able to accomplish the task.
If you want to use vSuperTrend, then check for the cross. With sTrend you simply need to check for
 
Code
if sTrend = 1 and sTrend[1] = -1

thx so much ABC once again. Can you explain where the specific difference between variables vSuperTrend & sTrend is?

Reply With Quote
 
  #68 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,410 since Apr 2013
Thanks: 220 given, 801 received
Forum Reputation: Legendary

The vSuperTrend carries the value of the Supertrend and sTrend carries the direction of the Supertrend indicator.
This will become clear if you plot both variables. On this image the blue line is vSuperTrend and the red line is displaying the value of sTrend.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).



Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #69 (permalink)
Trading Apprentice
Frankfurt / Germany
 
Futures Experience: Intermediate
Platform: NT, MC
Favorite Futures: Stocks, Futures
 
sagetrade's Avatar
 
Posts: 47 since Jul 2013
Thanks: 28 given, 10 received

But why do I need this sTrend variable at all?

When I look at my NinjaCode...


Quoting 
// Condition set 1
if (anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[1] > Close[1]
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[0] < Close[0])
{
EnterLong(RiskSize, "Buy Long");
}

// Condition set 2
if (Position.Quantity > 0
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[1] < Close[1]
&& anaSuperTrendM11(ATRStrength, ATRMult, ATRPeriod, false).StopDot[0] > Close[0])
{
ExitLong("Exit Long", "");
}

...there is no sTrend at all - just these three ATR variables.

Reply With Quote
 
  #70 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,410 since Apr 2013
Thanks: 220 given, 801 received
Forum Reputation: Legendary


You don't need it. The easiest thing is to just leave it in there, if you don't want to use it. You just have to use it as input of the function.
Otherwise delete the input and get rid of it within the code. This will leave you with the three ATR inputs to the function.

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG 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)

July Journal Challenge w/$1100 in prizes from TopstepTrader

July
 

An Afternoon with FIO member Softsoap

Elite only

Battlestations: Show us your trading desks and win $750 in prizes

August
 

Extended Ask Me Anything w/Brett Steenbarger

Elite only

Prototyping Python Strategies (part 3) w/Ran Aroussi

Elite only

Brannigan Barrett w/Axia Futures

Elite only

Introduction to Phillip Capital futures brokerage services

Aug TBD

How Monte Carlo Analysis Can Help Your Trading w/Kevin Davey

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 10:44 PM.

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-07-27 in 0.13 seconds with 21 queries on phoenix via your IP 54.144.36.228