hkusp40 |
Member, TeleChart
|
Registered User |
|
|
|
|
Unsure |
|
Sunday, July 13, 2008 |
Saturday, May 19, 2012 11:27:05 PM |
35 [0.01% of all post / 0.01 posts per day] |
|
I'm looking to create a fairly simple overlay using a 200 period linear regression with standard deviation bands around it for which the multiple can be adjusted. Another variation could use the ATR instead of the standard deviation. I've found linear regression channels to be helpful to me, but since they can only be drawn by hand on each chart, the overlay I described would be the next best thing. Any suggestions?
Thanks
|
Thank you Bruce!
|
As discussed by David Varadi on his blog, the MMDI is simply a MACD where the short term average is replaced by the median for the same period. So for example, the standard 12,26 MACD would become the median price for the last 12 bars minus the average for the last 26. He also mentions that he prefers to smooth the the resulting difference line using a 2-5 period SMA/EMA. I'd like to recreate this indicator in SF4 is possible.
So,
median of the last “n” days - average of the last “n” days = D
D is then smoothed and plotted. Can this be done?
|
If I may, bestfreecharts.com represents a very much stripped down version of SF in which there is no additional support for custom indicators or complex scans. Among many other features, these are the things that make SF4 really stand out. I was very excited to discover bestfreecharts.com but SF4 is still indispensible to me for my custom indicators and indexes, and canceling my service it has yet to cross my mind.
FWIW, hkusp40
|
It worked great. I appreciate the support, SG.
hkusp40
|
When I loaded SF4 today it updated to a new build and subsequently one of my plots, MIDAS, no longer appears. I noticed some RealCode changes in the volume functions and suspect that this is the cause. Here is the MIDAS code I'm using:
'***************************************
'* Example: Returns the net change *
'* Plot = Price.Close - Price.Close(1) *
'***************************************
'# Year = UserInput.Integer = 2008
'# Month = UserInput.Integer = 1
'# Day = UserInput.Integer = 1
'# Leave the Hour, Minute, Second values set to 0 for MIDAS.
'# Hour = UserInput.Integer = 0
'# Minute = UserInput.Integer = 0
'# Second = UserInput.integer = 0
Static StartDate As Date
Static CumPrice As Double
Static CumVolume.value As Double
If isFirstBar Then
StartDate = New Date(Year, Month, Day, Hour, Minute, Second)
CumPrice = 0
CumVolume.value = 0
End If
If CurrentDate >= StartDate Then
CumPrice += Price.Last * Volume.value
CumVolume.value += Volume.value
Plot = CumPrice / CumVolume.value
Else
Plot = Single.NaN
End If
'# Cumulative
How can I go about correcting this? Thanks.
hkusp40
|
Simple, yet effective. I'm grateful Bruce. Thanks.
|
I'm having a bit of a problem with scanning for a condition...
You're probably familiar with the MIDAS indicator and what it does. I am simply trying to scan for securities above or below a MIDAS plot and the results are not accurate. I've shared a layout to show you what I mean. The layout name is 'MIDAS problem'
I've plotted a longer term MIDAS and then created a rule to show stocks that are above this plot. If you flip through the passing stocks (using the Nas100 components is a good example) you'll notice that some are quite clearly below the plot. Likewise, some stocks that SF4 shows as not passing this condition are indeed above the MIDAS plot. If you were to sort the list by number a bars since true, the results are even more confounding.
Strangely, this problem seems to only occur when the MIDAS plot is a longer one. If you were to change the start date from 2003 up to 2008 you'll notice that the problem no longer exists. Any ideas?
Thanks again,
hkusp40
|
Exactly right, I just don't know how to program such an indicator.
|
The purpose of such an indicator, I should add, would be to identify situations in which price is moving up for example, but the indicator is beginning to move down due to longer tails up than down. One would look for divergences between the two to spot a loss of momentum in a particular direction.
|
|