Tradestation easylanguage indicators to Sierra Charts - Sierra Chart | futures io social day trading
futures io futures trading


Tradestation easylanguage indicators to Sierra Charts
Updated: Views / Replies:2,976 / 22
Created: by Renko123 Attachments:1

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
 1  
 
Thread Tools Search this Thread
 

Tradestation easylanguage indicators to Sierra Charts

  #1 (permalink)
Trading for Fun
Washington, DC USA
 
Futures Experience: Intermediate
Platform: Tradestation, SC
Favorite Futures: NQ, ES, YM
 
Posts: 56 since Nov 2013
Thanks: 9 given, 2 received

Tradestation easylanguage indicators to Sierra Charts

I have been thinking about moving from Tradestation over to Sierra Charts because Sierra Charts are free with my futures broker.
The issue and concern I have is reproducing my TS easylanguage coded indicators and strats I created myself over to Sierra Charts.
I`m not a C++ developer, but i do know TS Easylanguage and VB.net coding.
Can Sierra Charts run/create studies using/with vb.net code?

Reply With Quote
 
  #2 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received

No Sierrachart uses ACSIL and that's like c++. But if you can code in Easylanguage and vb.net learning how to do it in acsil is easy. I just made the switch myself. Once you've done your first indicator the rest is easy. Strategies is a bit harder i think.

Reply With Quote
 
  #3 (permalink)
Trading for Fun
Washington, DC USA
 
Futures Experience: Intermediate
Platform: Tradestation, SC
Favorite Futures: NQ, ES, YM
 
Posts: 56 since Nov 2013
Thanks: 9 given, 2 received


Thanks.
Hopefully, i can Google some open code sierra indicators and strats to learn from.
Off I go to learn c++ coding.

Reply With Quote
 
  #4 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received

Don't, just start with porting a simple indicator to Sierrachart. That way you can learn step by step by looking in the online Sierra ACSIl documentation. The first step is to make a template you can use over and over again. Like this:

 
Code
// The top of every source code file must include this line
#include <math.h> // other includes always before sierrachart.h !
#include "sierrachart.h"

/*****************************************************************************

	For reference, please refer to the Advanced Custom Study Interface
	and Language documentation on the Sierra Chart website. 
	
	Template is build up from 3 parts
	
*****************************************************************************/

// This line is required. Change the text within the quote marks to what you want to name your group of custom studies. 
SCDLLName("testIndicator") 

SCSFExport scsf_myIndicator(SCStudyInterfaceRef sc)
{	// Part 1 Reference and Initialize 3 things; the Plots and the inputs and if needed arrays
		CSubgraphRef 	IndicatorLine	 = sc.Subgraph[0];  //Output line an first array
		
		SCInputRef 	firstInput		= sc.Input[0]; // Input for Indicator
		
		SCFloatArrayRef calcArray  	= IndicatorLine.Arrays[0]; // can be used for calculations if needed
	
	
	if (sc.SetDefaults)
	{
	// Part 2 - Set the configuration variables and defaults
		sc.GraphName 		= "My first Indicator";
		sc.StudyDescription 	= "This is my Indicator template";		
				
		//sc.GraphRegion 	= 1;	// Set the Chart Region to draw the graph in.  Region 0 is the main price graph
		sc.FreeDLL 		= 1;	// During dev set this flag to 1, so DLL can be rebuilt without restarting Sierra 
		sc.AutoLoop 		= 1;	//Auto looping is enabled. 
		sc.ValueFormat 	= 2;
		
	// Reference the Plots and the inputs and define them
		IndicatorLine.Name 			= "EOT";
		IndicatorLine.DrawStyle 	        = DRAWSTYLE_LINE;		// Look in scconstants.h for other draw styles
		IndicatorLine.PrimaryColor 	= RGB(0,128,0);			// Green	
		IndicatorLine.SecondaryColor     = RGB(255, 128, 128);	      // Light Red
		IndicatorLine.LineWidth 	         = 3;
		IndicatorLine.AutoColoring	         = AUTOCOLOR_SLOPE;
				
		firstInput.Name			         = "Period";
		firstInput.SetInt(20);
		firstInput.SetIntLimits(1, INT_MAX);
				
		return;
	}

	// Part 3 - Do data processing here for real indicator building
	
		//SuperSmoother Filter
		float a1, b1, c2, c3, c1;
		a1 = exp((-1.414) * 3.14159 / firstInput.GetInt());
		b1 = 2 * a1 * cos(1.414*(180 * 3.14159 / 180) / firstInput.GetInt());
		c2 = b1;
		c3 = (-1)*a1*a1;
		c1 = 1 - c2 - c3;
				
		if (sc.Index < 2) IndicatorLine[sc.Index] = sc.BaseDataIn[SC_LAST][sc.Index];
		else IndicatorLine[sc.Index] = c1 * (sc.BaseDataIn[SC_LAST][sc.Index] + sc.BaseDataIn[SC_LAST][sc.Index -        1]) / 2 + c2 * IndicatorLine[sc.Index - 1] + c3 * IndicatorLine[sc.Index - 2];
}

Reply With Quote
The following user says Thank You to ehlaban for this post:
 
  #5 (permalink)
Trading for Fun
Washington, DC USA
 
Futures Experience: Intermediate
Platform: Tradestation, SC
Favorite Futures: NQ, ES, YM
 
Posts: 56 since Nov 2013
Thanks: 9 given, 2 received

Thanks for the code template.

Will go thru the online docs to learn how to manipulate bar color, create variables and presistant variables for strings, numbers and boolean.
How to access previous data from a variable ie ( value34[2] as used in TS coding).
Have to find the SC version of these TS functions (AVERAGE, MRO, BIGPOINTVALUE, ABSVALUE ) ;


Last edited by Renko123; January 3rd, 2015 at 11:29 PM.
Reply With Quote
 
  #6 (permalink)
Trading for Fun
Washington, DC USA
 
Futures Experience: Intermediate
Platform: Tradestation, SC
Favorite Futures: NQ, ES, YM
 
Posts: 56 since Nov 2013
Thanks: 9 given, 2 received

After going thru the sample code and online docs for Sierra, i see why there is hardly any commercial indicators or strats for Sierra Charts. You need to have a PHD to understand the code.


I still haven't figured out how to get the AVERAGE, MRO, ABSVALUE.

Tradestation its simple to do.
value18 = AVERAGE (ABSVALUE (high- high[5]), 8)
If MRO (value1 < value1[8] AND value1[1] > value1[3], 2, 1) > -1 then value2 = True;

All done in just 2 lines of code.

With Sierra Charts you need to be a professor at MIT.

Reply With Quote
 
  #7 (permalink)
Elite Member
Alesia E.U.
 
Futures Experience: Intermediate
Platform: Sierra chart
Favorite Futures: Futures
 
Posts: 166 since Feb 2011
Thanks: 139 given, 109 received

Hi

see here:

ACSIL Interface Members - Functions - Sierra Chart

Table of Contents - Sierra Chart


Quoting 
sc.MovingAverage()
[link] - [Top]
Type: Intermediate Study Calculation Function

SCFloatArrayRef MovingAverage(SCFloatArrayRef FloatArrayIn, SCFloatArrayRef FloatArrayOut, unsigned int MovingAverageType, int Index, int Length);

SCFloatArrayRef MovingAverage(SCFloatArrayRef FloatArrayIn, SCFloatArrayRef FloatArrayOut, unsigned int MovingAverageType, int Length); Auto-looping only.

The sc.MovingAverage() function calculates a Moving Average of the specified Type and Length.

Parameters:
FloatArrayIn
FloatArrayOut
Index
Length
MovingAverageType
Example
sc.MovingAverage(sc.BaseDataIn[SC_LAST], sc.Subgraph[0], MOVAVGTYPE_SIMPLE, 20);

float MovingAverage = sc.Subgraph[0][sc.Index]; //Access the study value at the current index



Reply With Quote
 
  #8 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received

Actually they are quite similar. But easylanguage as the name implies is much easier then real programming languages like C# as used in Ninja and other programs or ACSIL which is like C++. So you need to have a grasp of programming when using something other then easylanguage. It doesn't matter what program you choose. So your first decision is if you want to go that route as you have to learn how to program a bit.

On top of your file, like in my template include
#include <math.h> // other includes always before sierrachart.h !

Then you can acces all the math function you like in Sierra
<cmath> (math.h) - C++ Reference

For the average look at:
ACSIL Interface Members - Functions - Sierra Chart

To get the array of price values:
sc.BaseDataIn[SC_HIGH][sc.Index] or in your case sc.BaseDataIn[SC_HIGH][5] you can even do
sc.Close[sc.Index]

abs or fabs goes like abs(sc.BaseDataIn[SC_HIGH] - sc.BaseDataIn[SC_HIGH][5] )

don't know what MRO is?
Is average the average between 2 values or a moving average?

In Sierra you have to use arrays to store calculation results and for input for indicators.

Don't you have the complete code for a simple indicator I or others can translate to sierra as an example?


Renko123 View Post
After going thru the sample code and online docs for Sierra, i see why there is hardly any commercial indicators or strats for Sierra Charts. You need to have a PHD to understand the code.

I still haven't figured out how to get the AVERAGE, MRO, ABSVALUE.

Tradestation its simple to do.
value18 = AVERAGE (ABSVALUE (high- high[5]), 8)
If MRO (value1 < value1[8] AND value1[1] > value1[3], 2, 1) > -1 then value2 = True;

All done in just 2 lines of code.

With Sierra Charts you need to be a professor at MIT.


Reply With Quote
 
  #9 (permalink)
Trading for Fun
Washington, DC USA
 
Futures Experience: Intermediate
Platform: Tradestation, SC
Favorite Futures: NQ, ES, YM
 
Posts: 56 since Nov 2013
Thanks: 9 given, 2 received

I think i have figured out the tradestation ABSVALUE function with fabs.
float value1 += fabs (sc.high[sc.Index] - sc.high[sc.Index-1]);

For the tradestation AVERAGE it looks like im going to have to loop.
float value2 = 0;
float average = 0.0;

for (int i=1; i<=sc.Index; i++)
{
average += fabs (sc.high[i] - sc.high[i -5]);

}
value2 = average / 18;

The tradestation MRO(Most Recent Occurance) function is going to be a brain buster for this c++ beginner.

The MRO (Most Recent Occurrence) function returns the number of bars ago the specified expression was True. Or, if the specified expression did not occur within the last x number of bars, the function informs you of such.

Example
Value1 = MRO(Close>Open, 5, 1);
I call the MRO function in my indicator as such.
If MRO (value1 < value1[8] AND value1[1] > value1[3], 2, 1) > -1 then value2 = True;

Tradestation MRO function below:

{ Wrapper function calling consolidated most/least recent occurrence function }

inputs:
Test( truefalseseries ),
Length( numericsimple ),
Instance( numericsimple ) ; { 0 < Instance <= Length }

MRO = RecentOcc( Test, Length, Instance, 1 ) ;

**** MRO function calls a separate RecentOcc function below****
{ RecentOcc }
{ Consolidated most/least recent occurrence function }

inputs:
Test( truefalseseries ),
Length( numericsimple ),
Instance( numericsimple ), { Length >= Instance > 0 }
MLFlag( numericsimple ) ; { pass in 1 for Most Recent, -1 for Least Recent }

variables:
LengthCntr( 0 ),
InstanceCntr( 0 ) ;

if MLFlag = 1 then
LengthCntr = 0
else if MLFlag = -1 then
LengthCntr = Length - 1 ;

InstanceCntr = 0 ;

while LengthCntr >= 0 and LengthCntr < Length and InstanceCntr < Instance
begin
if Test[LengthCntr] then
InstanceCntr = InstanceCntr + 1 ;
LengthCntr = LengthCntr + MLFlag ;
end ;

if InstanceCntr = Instance and Instance > 0 then
RecentOcc = LengthCntr - MLFlag + ExecOffset
else
RecentOcc = -1 ; { will get this also when Instance > Length }

Reply With Quote
 
  #10 (permalink)
Elite Member
Netherlands
 
Futures Experience: Advanced
Platform: Ensign, Multicharts
Favorite Futures: SP500
 
Posts: 95 since Nov 2009
Thanks: 66 given, 56 received


In the ACS_Source folder there is a file called scstudyfunctions.cpp. In there are code examples to find the lowest and highest. Perhaps you can adapt them to find an input value. Arraysize - SrcIndex is difference in bars from last date i think.

Reply With Quote

Reply



futures io > > > > Tradestation easylanguage indicators to Sierra Charts

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
TradeStation EasyLanguage RadarScreen Indicator Code kitewind TradeStation 3 May 23rd, 2014 06:59 AM
Sierra charts and IB - order not cancelled in Sierra deepgreen Sierra Chart 5 December 22nd, 2013 10:08 AM
Global Variables (GV) in EasyLanguage for TradeStation/MultiCharts Big Mike EasyLanguage Programming 19 October 29th, 2013 04:07 PM
Tradestation 9 Easylanguage to Multi-charts easy language dtman EasyLanguage Programming 5 April 8th, 2012 02:07 PM


All times are GMT -4. The time now is 03:28 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-12-18 in 0.15 seconds with 20 queries on phoenix via your IP 54.163.209.109