TradeStation keyword question - futures io
futures io futures trading



TradeStation keyword question


Discussion in TradeStation

Updated
    1. trending_up 1,887 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 10 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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 keyword question

(login for full post details)
  #1 (permalink)
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received

Guys, simple question: in the following code, is the independent variable some sort of sequence of integers (EG if the length is 20, that the independent variable is 1-20), or is it the lagged price?

Value1 = RSquare(BarNumber,PriceH,Length);
If LinearRegSlope(PriceH, Length)<0 Then Value1 = -Value1;

The indicator I'm looking at is called R-squared autocorrelation, but I'm not overly familiar with tradeStation.

Thanks a lot.

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
What blockvolume is visible? - order processing
NinjaTrader
ZigZag with Depth and Backstep
EasyLanguage Programming
Webinar: Finding your own way in trading w/Adam Grimes
The Elite Circle
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
Where can I find Cost to Trade and Book Depth info?
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
109 thanks
Battlestations: Show us your trading desks!
109 thanks
Rank your Futures vs Stocks trading priority
44 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Bitcoin storage wallet recommendations
18 thanks
 
(login for full post details)
  #2 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


IlyaKipnis View Post
Guys, simple question: in the following code, is the independent variable some sort of sequence of integers (EG if the length is 20, that the independent variable is 1-20), or is it the lagged price?

Value1 = RSquare(BarNumber,PriceH,Length);
If LinearRegSlope(PriceH, Length)<0 Then Value1 = -Value1;

The indicator I'm looking at is called R-squared autocorrelation, but I'm not overly familiar with tradeStation.

Thanks a lot.

Do you mean the "BarNumber" variable?

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #3 (permalink)
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received



Hulk View Post
Do you mean the "BarNumber" variable?

I suppose I'm asking what both of those lines do. That is, am I doing a rolling linear regression on integer values specifying time, or am I doing the rolling linear regression on the price against a lagged version of itself?

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


IlyaKipnis View Post
I suppose I'm asking what both of those lines do. That is, am I doing a rolling linear regression on integer values specifying time, or am I doing the rolling linear regression on the price against a lagged version of itself?

I am not too good at math so I will stick to the first part of your question .

The first line calls a function called RSquare which takes 3 inputs, judging by the naming convention lets call them the independent input, the dependent input and length input.

The independent input, BarNumber, is a sequence of integers. For a given bar, it returns the sum of the bars in the chart before and including the given bar. If a length of 20 is specified and there are 500 bars in the chart, then the RSquare function will use the previous 20 values for this variable, i.e, 481-500.

The dependent variable seems to be an input and judging by its name, PriceH, it seems to be using the high of bars. You can verify this by the inputs to the study.

The returned value is held in a placeholder called "Value1".

The second line calculates the slope of the "PriceH" series using the same "Length" and changes the sign of the value returned in line 1 if the slope is negative.

I think.

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Hulk for this post:
 
(login for full post details)
  #5 (permalink)
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received


Hulk View Post
I am not too good at math so I will stick to the first part of your question .

The first line calls a function called RSquare which takes 3 inputs, judging by the naming convention lets call them the independent input, the dependent input and length input.

The independent input, BarNumber, is a sequence of integers. For a given bar, it returns the sum of the bars in the chart before and including the given bar. If a length of 20 is specified and there are 500 bars in the chart, then the RSquare function will use the previous 20 values for this variable, i.e, 481-500.

The dependent variable seems to be an input and judging by its name, PriceH, it seems to be using the high of bars. You can verify this by the inputs to the study.

The returned value is held in a placeholder called "Value1".

The second line calculates the slope of the "PriceH" series using the same "Length" and changes the sign of the value returned in line 1 if the slope is negative.

I think.

Right. I'm asking about that slope that's positive or negative. Is that also using those same integers (EG 481-500) as the independent variable in that second line as well?

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


IlyaKipnis View Post
Right. I'm asking about that slope that's positive or negative. Is that also using those same integers (EG 481-500) as the independent variable in that second line as well?

No. The inputs to the LinearRegSlope function is the PriceH variable so it is using whatever is being assigned to PriceH.

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received


Hulk View Post
No. The inputs to the LinearRegSlope function is the PriceH variable so it is using whatever is being assigned to PriceH.

I get that PriceH is the dependent variable (the y). What is the x? 1 through Length?

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,785 since Jun 2009
Thanks: 32,313 given, 97,575 received


IlyaKipnis View Post
Guys, simple question: in the following code, is the independent variable some sort of sequence of integers (EG if the length is 20, that the independent variable is 1-20), or is it the lagged price?

Value1 = RSquare(BarNumber,PriceH,Length);
If LinearRegSlope(PriceH, Length)<0 Then Value1 = -Value1;

The indicator I'm looking at is called R-squared autocorrelation, but I'm not overly familiar with tradeStation.

Thanks a lot.


IlyaKipnis View Post
I suppose I'm asking what both of those lines do. That is, am I doing a rolling linear regression on integer values specifying time, or am I doing the rolling linear regression on the price against a lagged version of itself?

Would need to see the RSquare function to understand the inputs, which looks like the bar number, High dataseries and a variable Length.

Would be evaluated once per bar by default.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


IlyaKipnis View Post
I get that PriceH is the dependent variable (the y). What is the x? 1 through Length?

Doesnt look like x begins at 1. x begins at BarNumber - length where BarNumber = the current number of bars in the chart so x should begin at 481 if the current bar being calculated was bar # 500 in the chart. If length was 20, x would be 481 through 500.

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #10 (permalink)
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received



Hulk View Post
Doesnt look like x begins at 1. x begins at BarNumber - length where BarNumber = the current number of bars in the chart so x should begin at 481 if the current bar being calculated was bar # 500 in the chart. If length was 20, x would be 481 through 500.

Alright, so Rsquare is the R-squared of the high of prices (y) with respect to bar number (x).
The slope, ALSO, is the high of prices (y) with respect to bar number(x)?

Started this thread Reply With Quote
 
(login for full post details)
  #11 (permalink)
Texas, USA
 
Experience: Advanced
Platform: TT Pro, Custom
Broker: dxFeed
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 249 since May 2014
Thanks: 596 given, 665 received


IlyaKipnis View Post
Alright, so Rsquare is the R-squared of the high of prices (y) with respect to bar number (x).
The slope, ALSO, is the high of prices (y) with respect to bar number(x)?

I think I am unable to translate the code to you. Lets just go by the documentation:


R-Square Function
R-Square (r2) is the coefficient of determination, which measures the proportion of variation that is explained by the independent variable in a regression model. This function takes the value of CoeffR for the specified Length and squares the value. that is, CoeffR(Length) * CoeffR(Length). The RSquared value can be interpreted as the proportion of the variance of Price with respect to the specified period (’Length’).

So, this function would use the PriceH over specified length to compute the value.


LinearRegSlope Function
Linear Regression is a concept also known as the "least squares method" or "best fit." Linear Regression attempts to fit a straight line between several data points in such a way that distance between each data point and the line is minimized.

Returns
A numeric value containing the slope of the current regression line.

Usage
The input Price can be hard coded with a bar attribute such as Close, Open, High, Low, and Volume or a numeric series type input. It can also be replaced with a valid EasyLanguage expression. For example: Close + Open, or Average(RSI(Close,14),14).

The input Length can be hard coded replaced with a numeric simple type input.

And this function calculates the slope of PriceH over the same length used in the previous function.

Hopefully this answers the question, otherwise I am out

Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > TradeStation keyword question


Last Updated on August 24, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



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