| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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.
|
|
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.
|
|

 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
|
|
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.
|
|
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.
|
|
|
Guest-1 |