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 |

Rolling or Static Quarters Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
cdurso
Posted : Thursday, July 12, 2012 6:26:35 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

When I'm referencing Quarterly Data using the code below does Stockfinder use static quarters or rolling 3 month periods?

 

Static customSymbol As PriceScripting
If isFirstBar Then
    Dim tf As New MonthlyTimeFrameProvider
    tf.NumMonths = 4
    customSymbol = PriceData(CurrentSymbol, tf)
End If
OpenValue = customSymbol.Open
HighValue = customSymbol.High
LowValue = customSymbol.Low
Plot = customSymbol.Last

 

also, why does tf.nummonths =4? shouldn't it be 3 for three months?

Bruce_L
Posted : Friday, July 13, 2012 9:13:02 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

It should be static and not rolling and you would want to use 3 instead of 4.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdurso
Posted : Friday, July 13, 2012 3:22:12 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

When I run this code on Quarterly charts it shows the signals properly most of the time but then there are a handful of quarters where it switches when the chart/price action clearly doesn't warrant a switch. i set up two conditions with the same code, except switching the pass/fail rule at the bottom so i get 'buy' and 'sell' arrows on the chart to indicate when the rule has been triggered. look at 6/30/11 and 6/30/12 on the chart for PRASX as an example.

 

Static qbuy As Integer

Static QSymbol As PriceScripting
If isFirstBar Then
    Dim tf As New MonthlyTimeFrameProvider
    tf.NumMonths = 3
    qSymbol = PriceData(CurrentSymbol, tf)
End If

Static mSymbol As PriceScripting
If isFirstBar Then
    Dim tf As New MonthlyTimeFrameProvider
    tf.NumMonths = 1
    mSymbol = PriceData(CurrentSymbol, tf)
End If

If price.high > qsymbol.high(1) * 1.01 Then qbuy = 1
If price.low < qsymbol.low(1) * .99 Then qbuy = 0
        
If qbuy = 0 Then fail
If qbuy = 1 Then pass

Bruce_L
Posted : Friday, July 13, 2012 3:55:11 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I'm not seeing anything wrong with how the Condition returns true on a PRASX quarterly chart for 6/30/11 and 6/20/12.

Attachments:
Quarterly.gif - 27 KB, downloaded 1,386 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdurso
Posted : Friday, July 13, 2012 3:58:29 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

my chart shows down arrows on those quarters when they should be up arrows. i don't know how to attach a chart to this post.

cdurso
Posted : Friday, July 13, 2012 4:03:16 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

the quarters ending June 2011 and 2012 should be true on your chart because the high values exceeded the previous quarters high or no sell signal was given since the last buy signal.

Bruce_L
Posted : Friday, July 13, 2012 4:06:37 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

As shown in the image attached to my previous post, they should be up arrows, not down arrows.

The high of June 2011 bar was not above 1.01 times the high of the previous quarter (which is plotted on the chart in red) and the low of the March 2011 bar was below the low of the previous quarter (which is plotted in yellow).

The low of the June 2012 bar was below .99 time the low of the previous quarter.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdurso
Posted : Friday, July 13, 2012 4:15:07 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

there's something strange going on. my chart of prasx looks different than yours. my chart shows the highs from 2011 are higher than the 2012 highs. is your program using different data than mine (adjusted fund data vs non-adjusted data or something? is there a way i can post my chart or email it to you?

Bruce_L
Posted : Friday, July 13, 2012 4:21:16 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I have no idea why your chart would look different than mine. The best topic of which I'm aware on how to post images in the forums is Inserting A Chart into A Worden post.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
cdurso
Posted : Friday, July 13, 2012 7:33:15 PM
Gold Customer Gold Customer

Joined: 12/30/2004
Posts: 29

 

ok, here is the chart.

Bruce_L
Posted : Monday, July 16, 2012 11:18:04 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I tested it when I posted my response, but apparently not well enough. Now my testing seems to result in a rolling 3-Month Quartery instead of fixed calendar based quarter when using the PriceDate Method on my computer.

Please try dragging and dropping the attached indicator with its Bar Interval set to Quarterly (or 3-Month) into the RealCode Editor instead of trying ot use the PriceData method for quarterly data.

You should be able to Open an attached Indicator directly into a running copy of StockFinder 5 (and save it from within StockFinder 5 if desired). You could also Save it to the \My Documents\StockFinder5\(Your Username)\My Indicators\ folder and then load it like you would any other Indicator (or Copy and Paste it there from wherever it Saves if you can't specify the destination directory when Saving).

Attachments:
Price History w Bar Interval.sfInd - 4 KB, downloaded 884 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.