NexusFi: Find Your Edge


Home Menu

 





TradeStation keyword question


Discussion in TradeStation

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




 
Search this Thread

TradeStation keyword question

  #1 (permalink)
 IlyaKipnis 
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
Posts: 52 since Aug 2014
Thanks Given: 4
Thanks Received: 39

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 NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


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 NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 IlyaKipnis 
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
Posts: 52 since Aug 2014
Thanks Given: 4
Thanks Received: 39



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
  #4 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


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 NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 IlyaKipnis 
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
Posts: 52 since Aug 2014
Thanks Given: 4
Thanks Received: 39


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
  #6 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


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 NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 IlyaKipnis 
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
Posts: 52 since Aug 2014
Thanks Given: 4
Thanks Received: 39


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
  #8 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,661


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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


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 NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 IlyaKipnis 
Philadelphia + NJ/US
 
Experience: Beginner
Platform: quantstrat
Trading: ETFs
Posts: 52 since Aug 2014
Thanks Given: 4
Thanks Received: 39



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




Last Updated on August 24, 2014


© 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