Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Same indicator different values Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
StefanB
Posted : Saturday, May 22, 2010 12:39:47 PM
Registered User
Joined: 1/22/2010
Posts: 7
I have a median price, (H+L)/2, indicator stored in my library.  I imported this into another indicator for use in creating an oscillator and noticed this was different to my indicator coded in another package.  Investigation showed that the imported median price must have different values.  To cut a long story short the following
                                        
'# med = indicator.MyLibrary.MedianPrice
plot = med.Close

produces different values to my imported indicator when charted in the same layout.  Differences are not consistent and vary from as small as .05 to 2.0+.  I must be doing something wrong but I cannot see where my mistake is.
Kermitp
Posted : Monday, May 24, 2010 10:27:09 AM
Registered User
Joined: 10/7/2004
Posts: 364
You need to supply more4 info, such any realcode involved, specific stocks with date and time of failure.  
Kuf
Posted : Monday, May 24, 2010 11:47:39 AM


Administration

Joined: 9/18/2004
Posts: 3,522
QUOTE (Kermitp)
You need to supply more4 info, such any realcode involved, specific stocks with date and time of failure.  


What Kermitp said.

Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
StefanB
Posted : Monday, May 24, 2010 3:07:19 PM
Registered User
Joined: 1/22/2010
Posts: 7
Not sure how much more info you want, I thought my query was fairly clear.

An indicator stored in my library called MedianPrice:

'|*** Indicator:MedianPrice
'|******************************************************************
Dim MP As Single
   
MP = (price.High + price.Low) / 2
   
plot = MP

A cut-down indicator I was working on called AO:
'|*** Indicator:AO
'|******************************************************************
'# med = indicator.MyLibrary.MedianPrice


plot = med.Value

Specific stocks - just because I have nothing else to do at  the moment looked at all Dow Jones Industrials and all showed discrepancies.  Date/Time of failure - any date/time I look at, as I originally stated the discrepancies are sometimes small and sometimes large but these two pieces of code are plotting different values.
StefanB
Posted : Monday, May 24, 2010 3:58:21 PM
Registered User
Joined: 1/22/2010
Posts: 7
After further investigation I find that if I create a new chart and plot median price from the indicator and plot it from an import there are no problems.  The discrepancies only exist when I edit another of my saved indicators AO:

'|*** Indicator:AO
'|******************************************************************
'# med = indicator.MyLibrary.MedianPrice
'# AO = indicator.Library.Awesome Oscillator

'plot = -(AO.Value)
plot = med.Value

to plot the median price.  I don't know whether there is a caching issue here or some other problem but since I only did this originally to check another problem with my indicator I will not worry too much about  this.  If I want to check something I will create a new test indicator rather than trying to modify an existing one.
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.