NexusFi: Find Your Edge


Home Menu

 





Tradestation easylanguage indicators to Sierra Charts


Discussion in Sierra Chart

Updated
    1. trending_up 7,867 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 22 posts
    2. attach_file 1 attachments




 
Search this Thread

Tradestation easylanguage indicators to Sierra Charts

  #11 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6

Thanks for all the help.
Things are looking better.
I have put the MRO headache on hold until some smaller issues can be solved and come back to the MRO issue later

The issue im working on now is:
In Tradestation if i wanted to access a previous value in a non persistent variable i would use.

value2 = average / 18; put in a new value
value3 = value2[1]; read out the previous value from the value2

In Sierra how would I get the previous value from value2 ?

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
23 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #12 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6

I see that my post has gotten 300 + views but only 2 people stepped up to offer assistance.
Thanks again to those 2 people.

Anyway, after finding out that its a waste of time to even ask Sierra support for assistance with using their product.
Tradestation and Sierra support is like night and day.
Tradestation support steps up right away to help the users of their software, Sierra will tell you a "Its easy to program" and then don't post any example code and then never reply to the post again.


After a lot of cursing, I`m getting closer to getting the TS indicator ported over..
Now I need to know how to plot a point at a specified price on the chart at sc.index current bar.

I`m temped to just give up on Sierra charts and stick with Tradestation.
The EL language makes common sense and if you have a coding problem, the techs step up right away to answer your post until the problem is solved.

Sierra support, forget about it.

Reply With Quote
  #13 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 91 since Nov 2009
Thanks Given: 66
Thanks Received: 57



Renko123 View Post
Thanks for all the help.
Things are looking better.
I have put the MRO headache on hold until some smaller issues can be solved and come back to the MRO issue later

The issue im working on now is:
In Tradestation if i wanted to access a previous value in a non persistent variable i would use.

value2 = average / 18; put in a new value
value3 = value2[1]; read out the previous value from the value2

In Sierra how would I get the previous value from value2 ?

This is exactly the same in Sierra. You can get previous values in an array the same way.

value3 = value2[1];

So you have to use arrays to store the values.

Reply With Quote
  #14 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6


ehlaban View Post
This is exactly the same in Sierra. You can get previous values in an array the same way.

value3 = value2[1];

So you have to use arrays to store the values.

Yes, in Sierra have to create an array and loop to fill it.
double value2[11];
for ( int i = sc.Index; i >= sc.Index -10; i--)
{
value2[i] = fabs (sc.Close[i -10] - sc.Close[i]);
}

However in TS you don't have to deal with creating an array and looping to fill it.
value2= fabs (sc.Close[i -10] - sc.Close[i]);
and when you need that value later just call it.
value3=value2[1];

Unless, I`m wrong with having to loop to fill the array in Sierra?

How would I plot a dot on the chart on the current bar with Sierra?

In TS it is simple:
PLOT1 (value3, "ExitPrice") ;

Thanks for all your help again.

Reply With Quote
  #15 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115

SCSubgraphRef PLOT = sc.Subgraph[0];


// Section 1 - Set the configuration variables and defaults
if (sc.SetDefaults)
{


PLOT.Name = "ExitPrice";
PLOT.DrawStyle = DRAWSTYLE_POINT;


return;
}
// Section 2 - Do data processing here


PLOT[sc.Index]=value3;

Reply With Quote
Thanked by:
  #16 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 91 since Nov 2009
Thanks Given: 66
Thanks Received: 57


Renko123 View Post
Yes, in Sierra have to create an array and loop to fill it.
double value2[11];
for ( int i = sc.Index; i >= sc.Index -10; i--)
{
value2[i] = fabs (sc.Close[i -10] - sc.Close[i]);
}

However in TS you don't have to deal with creating an array and looping to fill it.
value2= fabs (sc.Close[i -10] - sc.Close[i]);
and when you need that value later just call it.
value3=value2[1];

Unless, I`m wrong with having to loop to fill the array in Sierra?

How would I plot a dot on the chart on the current bar with Sierra?

In TS it is simple:
PLOT1 (value3, "ExitPrice") ;

Thanks for all your help again.

Look at the source code i provided especially at calcArray
In Sierra you normally don't have to fill an array with a loop as it's the same as in TS or Easylanguage.

Just define an array.
While calculating your indicator (it starts from the first chart point) fill your array as well just like value2[sc.Index]
if you have defined a name and drawstyle for calcArray it plots automatically, like in TS
calcArray.Name = "myLine";
calcArray.DrawStyle = DRAWSTYLE_LINE;

Reply With Quote
  #17 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6


crazybears View Post
SCSubgraphRef PLOT = sc.Subgraph[0];


// Section 1 - Set the configuration variables and defaults
if (sc.SetDefaults)
{


PLOT.Name = "ExitPrice";
PLOT.DrawStyle = DRAWSTYLE_POINT;


return;
}
// Section 2 - Do data processing here


PLOT[sc.Index]=value3;

Since I already have a reference that uses sc.Subgraph[0].
I used sc.Subgraph[1] unless multiple refs can use the same sc.Subgraph[0]?
Plot still isn't applied at the correct place on the chart.
 
Code
SCSubgraphRef Sideways = sc.Subgraph[0];
SCSubgraphRef bullish  = sc.Subgraph[1];

bullish.Name = "Bullish"; 
bullish.DrawStyle = DRAWSTYLE_POINT;

futher down into the processing code I applied.
bullish[sc.Index] = 4155.00;  // hard coded to test if plot shows up.

The plot does not show up at 4155.00, it shows up at the top of the bar only
See image.

Reply With Quote
  #18 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6


ehlaban View Post
Look at the source code i provided especially at calcArray
In Sierra you normally don't have to fill an array with a loop as it's the same as in TS or Easylanguage.

Just define an array.
While calculating your indicator (it starts from the first chart point) fill your array as well just like value2[sc.Index]
if you have defined a name and drawstyle for calcArray it plots automatically, like in TS
calcArray.Name = "myLine";
calcArray.DrawStyle = DRAWSTYLE_LINE;

I looked at it and it just confuses me more.
Are you saying that if I do this:

double value2[6]; declare array
value2[sc.Close[sc.Index -3] - sc.Close[sc.Index]] ;

That it will fill all 7 place holders in the array without me having to "for" loop thru manually and fill it?

I tried that and got an "Error: expression must have and integral or enum type".

Reply With Quote
  #19 (permalink)
 ehlaban 
Netherlands
 
Experience: Advanced
Platform: Ensign, Multicharts
Trading: SP500
Posts: 91 since Nov 2009
Thanks Given: 66
Thanks Received: 57

Working with Arrays and Looping - Sierra Chart

No

sc.Subgraph[0]
sc.Input[0]
are arrays, so:

SCSubgraphRef 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

are all array definitions with a normal name like calcArray.
Those arrays are always the same size as there are bars in the chart. When loaded with auto looping
and sc.Index everything is calculated from the first bar to the last. sc.Index keeps track of it.

if you want to lookup values 3 bars to the left [sc.Index-3] and you start from 0 you should do something like:

if (sc.Index < 2) Filt[sc.Index] = sc.BaseDataIn[SC_LAST][sc.Index];
else Filt[sc.Index] = c1 * (sc.BaseDataIn[SC_LAST][sc.Index]


Renko123 View Post
I looked at it and it just confuses me more.
Are you saying that if I do this:

double value2[6]; declare array
value2[sc.Close[sc.Index -3] - sc.Close[sc.Index]] ;

That it will fill all 7 place holders in the array without me having to "for" loop thru manually and fill it?

I tried that and got an "Error: expression must have and integral or enum type".


Reply With Quote
  #20 (permalink)
Renko123
Washington, DC USA
 
Posts: 64 since Nov 2013
Thanks Given: 12
Thanks Received: 6



Renko123 View Post
Since I already have a reference that uses sc.Subgraph[0].
I used sc.Subgraph[1] unless multiple refs can use the same sc.Subgraph[0]?
Plot still isn't applied at the correct place on the chart.
 
Code
SCSubgraphRef Sideways = sc.Subgraph[0];
SCSubgraphRef bullish  = sc.Subgraph[1];

bullish.Name = "Bullish"; 
bullish.DrawStyle = DRAWSTYLE_POINT;

futher down into the processing code I applied.
bullish[sc.Index] = 4155.00;  // hard coded to test if plot shows up.

The plot does not show up at 4155.00, it shows up at the top of the bar only
See image.

Ok, I got the plot working now.
Issue was the setting in the study on the chart.
Even tho i had the bullish.DrawStyle = DRAWSTYLE_POINT the chart was overriding the code by having the "point high" selected in the DrawStyle.

Thanks for the help. the plotting problem is fixed.

Reply With Quote




Last Updated on February 6, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts