Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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?
Can you help answer these questions from other members on NexusFi?
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.
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:
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 ) ;
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.
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 !
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 }
**** 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 }
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.