# Indicator vs strategy discrepancy

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)

# Indicator vs strategy discrepancy

bluefightingcat
Espoo Finland

Experience: Intermediate

Posts: 41 since Sep 2015

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");```

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 ExegyPlatforms and Indicators What is Your Experience with TradeStations API?TradeStation TradeStation live and dev environmentsPlatforms and Indicators TickeronTrading Reviews and Vendors

in the last 7 days on futures io
 Big Mike in Ecuador42 thanks top trading courses13 thanks Trader Sentiment Tool for our community11 thanks futures io site changelog and issues/problem reporting11 thanks Hedge your losers to turn them into winners10 thanks

kevinkdog

Posts: 3,540 since Jul 2012

bluefightingcat
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.

 The following user says Thank You to kevinkdog for this post:

bluefightingcat
Espoo Finland

Experience: Intermediate

Posts: 41 since Sep 2015

kevinkdog
 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.

 (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.

 futures io > 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