Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Profile: shamilton
About
User Name: shamilton
Groups: Gold User, Member, Platinum User, TeleChart
Rank: Registered User
Real Name:
Location
Occupation:
Interests:
Gender: Unsure
Statistics
Joined: Tuesday, January 25, 2005
Last Visit: Thursday, April 7, 2011 7:13:26 AM
Number of Posts: 13
[0.00% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Plot a horizontal line for a custom indicator
Posted: Thursday, November 4, 2010 6:54:38 AM

I have a custom indicator and I would like to plot a horizontal line for the value calculated on the last bar of the chart.  Is this possible?

Topic: StockFinder Build 38 Now Available
Posted: Saturday, October 30, 2010 6:04:07 PM
Thanks for the tip Winnie.  I didn't think to try that.

Shawn
Topic: StockFinder Build 38 Now Available
Posted: Saturday, October 30, 2010 6:03:20 PM

Thanks Doug for the quick action on this one.  I can confirm that the roll-back has fixed the issue.  Success in finding the solution for the build 38 issue.

Topic: “Worden Best of 2009 Training Class Video Series Step by Step” instructions on how to generate RealC
Posted: Saturday, October 30, 2010 11:26:25 AM
Whoops.... sorry GJU, I didn't look closely enough at your screenshot.  I see now that you are creating a realcode condition.  I typed in your code and it worked on my system.

I see there are no compile errors in the screenshot so I think the code is correct.  The condition was added to my Price History chart but I had to 'Show True Markers' for it to display the results.  Symbol AAPL shows a pass condition on 08/23/10.

Shawn
Topic: “Worden Best of 2009 Training Class Video Series Step by Step” instructions on how to generate RealC
Posted: Saturday, October 30, 2010 11:15:18 AM
It looks like this code is for a 'Realcode Condition'.  Your screenshot shows you are creating a 'Realcode Indicator'.  Try selection 'New Realcode Condition' instead

Shawn
Topic: StockFinder Build 38 Now Available
Posted: Saturday, October 30, 2010 11:03:35 AM

It appears that the this update has caused a serious problem for me.  The data column does not show the correct values for an indicator.  To demostrate the issue I'm having:

1) Goto 'File' and 'New Layout'.  Select the 'Stockfinder Default Layout'.
2) Right-Click on the MovAvg21 of the Price History and select 'Data' from 'Create Watchlist Column'.

The values shown in the Data column are not correct on my system.  This is a huge issue for me and I cannot trade on Monday without this fixed.

Please adivse ASAP.

Topic: Condition for Stocks in Trading Range
Posted: Thursday, August 26, 2010 2:11:57 AM
Glad to help and you're welcome.

Take care,
Shawn
Topic: Condition for Stocks in Trading Range
Posted: Wednesday, August 25, 2010 4:54:52 AM

Hi chrfialia76,

This one is fairly easy to fix.  The reason that it's not calculation anything is because you have Dim'ed your Fuzzy and Retraction variables as Integer.  They should be Single as you are using decimals.   The way you have it they will be 0.

I don't completely understand everything you are doing but I do have a couple of other suggestions that might help:

#1) I don't think 'Low' is calculating a value.  When you initialize it using the Dim statement it will start off with a value of 0 and you can't get any lower than that with price.  

#2) The loop you use to calculate the high and low of the tradingrange can be replaced with the statement

High = Price.MaxHigh(Tradingrange)
Low = Price.MinLow(Tradingrange)

Now you can fix both #1 and #2  by using the following statements after the Dim statement for TradingRange:

Dim High as Single = Price.MaxHigh(TradingRange)
Dim Low as Single = Price.MinLow(TradingRange)


#3) To speed things up a bit you might want to calculate the fuzzy upper and lower limits outside the loop.  If you decide to use the suggestion above for High and Low then you can add the follow Dim statements right after (also after the Dim statement for Fuzzy):

Dim FHighUpper As Single = High * (1 + Fuzzy)
Dim FHighLower As Single = High * (1 - Fuzzy)
Dim FLowUpper As Single = Low * (1 + Fuzzy)
Dim FHighLower As Single = Low * (1 - Fuzzy)

You might want to do this for the Retraction calculation.

I pasted below what your second loop would look like if you use the above suggestion.  You may notice a few other minor things.  The "AndAlso" statement is used to speed things up a fraction.  It will not execute the remainder of the if statement if the first part is not true. Also, I assumed you only want to check 30 bars (tradingrange) therefore "i" should be from 0, which is the current bar, to 29 which is the 30th bar.

For i As Integer = 0 To TradingRange - 1
       
 If Price.High(i) < HighFuzzyUpper AndAlso Price.High(i) > HighFuzzyLower Then
  If LastIsHigh Then
   TouchHigh = TouchHigh + 1
  End If
  LastIsHigh = True
 End If
       
 If LastIsHigh And (Price.High(i) < High * (1 - Retraction)) Then
  LastIsHigh = False   
 End If
       
 If Price.Low(i) < LowFuzzyUpper AndAlso Price.Low(i) > LowFuzzyLower Then
  If LastIsLow Then
   TouchLow = TouchLow + 1
  End If
  LastIsLow = True
 End If
       
 If LastIsLow And (Price.Low(i) > Low * (1 + Retraction)) Then
  LastIsLow = False   
 End If

Next

Kind Regards,
Shawn

Topic: Realcode Optimization Help for Custom Indicators
Posted: Monday, August 23, 2010 8:41:23 AM

Hello,

I have written a couple of realcode indicators.  Is there someone who can have a look and suggest any optimizations.  They are use with streaming data and have conditions attached to them.
The conditions I use are:

1) TradeRange > 98
2) TradeRange < 02
3) VolumeSurge > 3

I combine the conditions into a combo condition and then sort my watchlist on the combo condition by bars since true.   I really only need to know when the conditions are met on the current bar.  I use this with realtime data so I would like it to be as quick as possible.

Any help with this is greatly appreciated.

Thanks,
Shawn


#1 Volume Surge (Intraday): This indicator calculates volume surge. It's a little different though as it calculates the average volume per bar time.  For example if you use 10 MovAvgDays on a 30 minute chart it will (or should ) add up past ten 10am bars to calculate the volume surge for the 10am bar and so on.   I did it this way because there is usually higher volume in the morning and afternoon and I wanted to normalize this.

'# MovAvgDays = UserInput.integer = 10

Dim BarsPerDay As Integer
Dim Count As Integer
Dim VolumeSurge As Single = 0
Dim VolumeAverage As Single = 0

' Calculate BarsPerDay if Intraday
If Me.BarInterval.Days > 0 Then
 ' Daily or higher
 BarsPerDay = 1
Else
 ' Intraday
 BarsPerDay = System.Math.Round(.4999 + 390 / Me.BarInterval.TotalMinutes)
End If

' Calculate VolumeSurge 
For Count = 1 To (MovAvgDays * BarsPerDay) Step BarsPerDay
 VolumeAverage += Volume.Value(Count - 1)
Next Count
VolumeAverage = VolumeAverage / MovAvgDays
VolumeSurge = Volume.Value / VolumeAverage
 
Plot = VolumeSurge



#2 Trade Range (Intraday): Most of this code is from another post and was written by Bruce L - see post S.F 5.0 scan please .  This indicator can be used on a intraday chart to correctly calculate the percent trade range for the current day.

Static DayLow As Single
Static DayHigh As Single
Static Valid As Boolean
If isFirstBar Then
 DayLow = Single.NaN
 DayHigh = Single.NaN
 Valid = False
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
 DayLow = Price.Low
 DayHigh = Price.High
 Valid = True
End If
DayLow = System.Math.Min(DayLow, Price.Low)
DayHigh = System.Math.Max(DayHigh, Price.High)
If Valid = True Then
 If DayHigh > DayLow Then
  Plot = 100 * (Price.Last - DayLow) / (DayHigh - DayLow)
 End If
Else
 SetIndexInvalid
End If