futures io



Indicator vs strategy discrepancy


Discussion in TradeStation

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




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

Indicator vs strategy discrepancy

(login for full post details)
  #1 (permalink)
 bluefightingcat 
Espoo Finland
 
Experience: Intermediate
Platform: TradingBlox, Tradestation
Trading: Stocks
 
Posts: 41 since Sep 2015
Thanks: 2 given, 10 received

Ok so I have an indicator plotted on my chart. I have the very same indicator code inserted as part of my strategy. However to my dismay I discovered that the values between the indicator and the strategy are slightly off. It seems that the indicator is calculated differently compared to when the exact same code is part of a strategy.

What could be causing this and is there a solution?

Here is the indicator code:

 
Code
Inputs: iLenRSI(3), iLenUP(2), iLenROC(100);

Var: vUpArray(0), vDownArray(0), vUpDown(0), vCRSI(0);

vUpArray = MRO(C<=C[1],100,1);
vDownArray = MRO(C>=C[1],100,1);
vUpDown = IFF(C=C[1], 0, IFF(vUpArray>0,vUpArray,-vDownArray));

vCRSI = (RSI(C,iLenRSI) + RSI(vUpDown, iLenUP) +
100*PercentRank(RateOfChange(C,1),RateOfChange(C,1),iLenROC+1))/3;

Plot1(vCRSI, "CRSI");

Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Need a bit of help putting pieces together :)
Traders Hideout
Rival systems and Exegy
Platforms and Indicators
What is Your Experience with TradeStations API?
TradeStation
TradeStation live and dev environments
Platforms and Indicators
Tickeron
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
42 thanks
top trading courses
13 thanks
Trader Sentiment Tool for our community
11 thanks
futures io site changelog and issues/problem reporting
11 thanks
Hedge your losers to turn them into winners
10 thanks

 
(login for full post details)
  #2 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,540 since Jul 2012
Thanks: 1,846 given, 7,108 received


bluefightingcat View Post
Ok so I have an indicator plotted on my chart. I have the very same indicator code inserted as part of my strategy. However to my dismay I discovered that the values between the indicator and the strategy are slightly off. It seems that the indicator is calculated differently compared to when the exact same code is part of a strategy.

What could be causing this and is there a solution?

Here is the indicator code:

 
Code
Inputs: iLenRSI(3), iLenUP(2), iLenROC(100);

Var: vUpArray(0), vDownArray(0), vUpDown(0), vCRSI(0);

vUpArray = MRO(C<=C[1],100,1);
vDownArray = MRO(C>=C[1],100,1);
vUpDown = IFF(C=C[1], 0, IFF(vUpArray>0,vUpArray,-vDownArray));

vCRSI = (RSI(C,iLenRSI) + RSI(vUpDown, iLenUP) +
100*PercentRank(RateOfChange(C,1),RateOfChange(C,1),iLenROC+1))/3;

Plot1(vCRSI, "CRSI");


Make sure the lookback length (MaxBarsBack) is set to the same. Strategy default is 50, you can change it. Indicators have "auto detect" as default, you can change it.

Make both the same value.

Follow me on Twitter Reply With Quote
The following user says Thank You to kevinkdog for this post:
 
(login for full post details)
  #3 (permalink)
 bluefightingcat 
Espoo Finland
 
Experience: Intermediate
Platform: TradingBlox, Tradestation
Trading: Stocks
 
Posts: 41 since Sep 2015
Thanks: 2 given, 10 received



kevinkdog View Post
Make sure the lookback length (MaxBarsBack) is set to the same. Strategy default is 50, you can change it. Indicators have "auto detect" as default, you can change it.

Make both the same value.

I tried that. Unfortunately it didn't help.

I'm using two different symbols in the strategy. I did some testing and it seems to me that the problem arises when I update the code of the indicator in the strategy to reference "Data2".
In theory there shouldn't be any discrepancy because when comparing the strategy with the indicator code, with the indicator one a single data stream, everything works fine.

So I suspect there is something wrong with my code when I try and use Data2 on the indicator.

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 bluefightingcat 
Espoo Finland
 
Experience: Intermediate
Platform: TradingBlox, Tradestation
Trading: Stocks
 
Posts: 41 since Sep 2015
Thanks: 2 given, 10 received

I found my mistake. It was a typo in my code.

Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > Indicator vs strategy discrepancy


Last Updated on March 21, 2023



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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