Tradestation easylanguage indicators to Sierra Charts - futures io
futures io futures trading



Tradestation easylanguage indicators to Sierra Charts


Discussion in Sierra Chart

Updated by Renko123
    1. trending_up 4,815 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 22 replies
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Tradestation easylanguage indicators to Sierra Charts

(login for full post details)
  #1 (permalink)
Washington, DC USA
 
 
Posts: 57 since Nov 2013
Thanks: 10 given, 4 received

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

Can you help answer these questions
from other members on futures io?
Macros for flatten and reverse
TradeStation
Thinkscript for scanning in Option Hacker
ThinkOrSwim
I have segregated my investment and trading
Psychology and Money Management
3x Fangdango
Traders Hideout
NinjaTrader Applications Rejected
Brokers
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
56 thanks
Coronavirus COVID-19
19 thanks
Price Action Kewltech Style
19 thanks
Trying to locate prop firm that purchased my automated trading system
10 thanks
The CL Crude-analysis Thread
9 thanks
 
(login for full post details)
  #2 (permalink)
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
 
Posts: 92 since Nov 2009
Thanks: 66 given, 57 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
 
(login for full post details)
  #3 (permalink)
Washington, DC USA
 
 
Posts: 57 since Nov 2013
Thanks: 10 given, 4 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
 
(login for full post details)
  #4 (permalink)
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
 
Posts: 92 since Nov 2009
Thanks: 66 given, 57 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:
 
(login for full post details)
  #5 (permalink)
Washington, DC USA
 
 
Posts: 57 since Nov 2013
Thanks: 10 given, 4 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 ) ;

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Washington, DC USA
 
 
Posts: 57 since Nov 2013
Thanks: 10 given, 4 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
 
(login for full post details)
  #7 (permalink)
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
 
Posts: 168 since Feb 2011
Thanks: 146 given, 112 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
 
(login for full post details)
  #8 (permalink)
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
 
Posts: 92 since Nov 2009
Thanks: 66 given, 57 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
 
(login for full post details)
  #9 (permalink)
Washington, DC USA
 
 
Posts: 57 since Nov 2013
Thanks: 10 given, 4 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
The following user says Thank You to Renko123 for this post:
 
(login for full post details)
  #10 (permalink)
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
 
Posts: 92 since Nov 2009
Thanks: 66 given, 57 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


futures io Trading Community Platforms and Indicators Sierra Chart > Tradestation easylanguage indicators to Sierra Charts


February 6, 2015


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 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