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 |

gap ups that have crossed plus to minus and gapdowns minus to plus Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
nandaulgolog
Posted : Saturday, October 9, 2010 8:46:36 AM
Registered User
Joined: 5/16/2010
Posts: 33
Hello Bruce,

 Would like a condition screen for gap up stocks which after trading above their opening price (would like to have at least a bar trading above) have dropped below the opening price... And one for gap downs that have started trading above opening.

(I tried to adopt from existing codes but was not successful)
Bruce_L
Posted : Monday, October 11, 2010 11:19:00 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Is the Condition for an Intrady Bar Interval or a 1-Day Bar Interval?

Is the Opening Price just the Open of the first Bar of the Trading Day or does it involve the entire Range of the first Bar of the Trading Day?

Does Trading above the Opening Price mean the High of the Bar is above the Opening Price or the Close of the Bar is above the Opening Price?

Does a Gap Up mean the Low is above the High of the previous Trading Day, the Open is above the High of the previous Trading Day or the Open is above the Close of the previous Trading Day? If it involves the Open, does the Open mean the entire Range of the first Bar of the Trading Day or just the Open of the first Bar of the Trading Day?

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
nandaulgolog
Posted : Friday, October 15, 2010 7:25:55 AM
Registered User
Joined: 5/16/2010
Posts: 33
Bruce,

intraday... gap up/down could be the opening price of the first bar... above / below could be the crossing up or down of the opening of the first bar.  If processing overhead does not increase much, it could ignore the first 5-15 minutes after opening when prices are hectic (or I can just not use it during that time period)

I hope the following does not try your patience (too much) but there is another sort I  would love to have. This would be just for the first 5-15 minutes from opening intraday, hopefully making it a little easier to trade the hectic opening minutes. A fast sort for percent up (no need to convert to percent really, decimal fraction would be more than fine) or percent down from the opening price of the first bar 

thanks for all your patience and help
nandaulgolog
Posted : Friday, October 15, 2010 8:43:28 AM
Registered User
Joined: 5/16/2010
Posts: 33
never ends.... Hope this will be the last for a long while

the condition in one of the posts on the 13th  titled "Price Crossing up through a Low" is attractive. the original request was for " 1) Price is after making a new low (15 minute low bar), a new low for today and yesterday’s trading range. Call this the “low bar”.2) I want the rule to trigger when price (15 minute bar) is crossing up through the high of “low bar”, anytime in today’s trading range " 

I'd love to see two alterations that may allow tighter entries: (1) instead of the high of the "low bar", the low of the low bar being the signal generator (i.e. the next bar is not a new low) and (2) I'd like it to be a binary sort yes/no or 1/0  (all I would care to see would be when the current bar is crossing or opening above, and further bars above the "low bar" (after the first or crossing would be zeros)...

(I generally prefer sorts and don't like limiting my watchlist with condition filters.) 
nandaulgolog
Posted : Wednesday, October 20, 2010 9:42:36 PM
Registered User
Joined: 5/16/2010
Posts: 33
Bruce,

If you get to see these follow up messages: re gap up gap down crossing indicator I was asking about, forget it... I am just using one of the other indicators / conditions on these pages- something like "trading above or below the opening range", and  it serves the same purpose... also forget about the request above... I've learned how to use conditions  as data columns so I solved my issue... thanks
Bruce_L
Posted : Monday, October 25, 2010 10:36:24 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
I'm sorry I didn't get back to you sooner as I was on vacation. I'm happy to read you were able to figure out a solution on your own.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
nandaulgolog
Posted : Friday, October 29, 2010 1:18:09 PM
Registered User
Joined: 5/16/2010
Posts: 33
Bruce,

It seems like a condition serving as a crossdown /crossup signal would still be nice because it would be a discrete event and rarer than the range thing I am using... Thanks 
Bruce_L
Posted : Friday, October 29, 2010 3:00:08 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
After all of the clarifications, I am more confused about what you want then when I first asked for more details. That said, I have some RealCode Conditions you might wish to try (you can Sort by Conditions).

A RealCode Condition for my interpretation of a crossdown through the open after a gap up could be written as:

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Crossdown through Open after Gap Up
'|******************************************************************
Static DayOpen As Single
Static DayHigh As Single
Static Days As Integer
If isFirstBar Then
    DayOpen = Single.NaN
    DayHigh = Single.NaN
    Days = 0
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
    If Price.Open > DayHigh Then
        DayOpen = Price.Open
    Else
        DayOpen = Single.NaN
    End If
    DayHigh = Price.High
    Days += 1
End If
DayHigh = System.Math.Max(DayHigh, Price.High)
If Days >= 2 Then
    If Price.Last < DayOpen AndAlso _
        Price.Last(1) >= DayOpen Then
        Pass
    End If
Else
    SetIndexInvalid
End If

While a RealCode Condition for my interpretation of a crossup through the open after a gap down could be written as:

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Crossup through Open after Gap Down
'|******************************************************************
Static DayOpen As Single
Static DayLow As Single
Static Days As Integer
If isFirstBar Then
    DayOpen = Single.NaN
    DayLow = Single.NaN
    Days = 0
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
    If Price.Open < DayLow Then
        DayOpen = Price.Open
    Else
        DayOpen = Single.NaN
    End If
    DayLow = Price.Low
    Days += 1
End If
DayLow = System.Math.Min(DayLow, Price.Low)
If Days >= 2 Then
    If Price.Last > DayOpen AndAlso _
        Price.Last(1) <= DayOpen Then
        Pass
    End If
Else
    SetIndexInvalid
End If

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
caution
Posted : Thursday, January 17, 2013 12:43:37 PM
Registered User
Joined: 5/5/2010
Posts: 185

Is it possible to reconfigure above real code for intraday use with user defined bar count?

Bruce_L
Posted : Thursday, January 17, 2013 12:55:05 PM


Worden Trainer

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

I do not understand your request. Do you want the RealCode Conditions to expire after a user specified number of bars after the open and not trigger? Do you want to look for gaps over a user defined span of previous bars and then check for a cross over the interim? Something else?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
caution
Posted : Thursday, January 17, 2013 1:36:31 PM
Registered User
Joined: 5/5/2010
Posts: 185

Correct, the condition should expire after a user specified number of bars.  The gap up/down must occur on the first bar(begining of day).  If price history trades below/above (respectively) the opening price(begining of day), then the condition should trigger.

thanks.

Bruce_L
Posted : Thursday, January 17, 2013 2:41:42 PM


Worden Trainer

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

Adding an expiration to the first Condition would result in:

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Crossdown through Open after Gap Up
'|******************************************************************
'# Expiration = UserInput.Integer = 400
Static DayOpen As Single
Static DayHigh As Single
Static Days As Integer
Static SinceOpen As Integer
SinceOpen += 1
If isFirstBar Then
    DayOpen = Single.NaN
    DayHigh = Single.NaN
	Days = 0
	SinceOpen = 0
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
    If Price.Open > DayHigh Then
        DayOpen = Price.Open
    Else
        DayOpen = Single.NaN
    End If
    DayHigh = Price.High
	Days += 1
	SinceOpen = 0
End If
If SinceOpen >= Expiration Then
	DayOpen = Single.NaN
End If
DayHigh = System.Math.Max(DayHigh, Price.High)
If Days >= 2 Then
    If Price.Last < DayOpen AndAlso _
        Price.Last(1) >= DayOpen Then
        Pass
    End If
Else
    SetIndexInvalid
End If

Adding an expiration to the second Condition would result in:

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Crossup through Open after Gap Down
'|******************************************************************
'# Expiration = UserInput.Integer = 400
Static DayOpen As Single
Static DayLow As Single
Static Days As Integer
Static SinceOpen As Integer
If isFirstBar Then
    DayOpen = Single.NaN
    DayLow = Single.NaN
	Days = 0
	SinceOpen = 0
Else If Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then
    If Price.Open < DayLow Then
        DayOpen = Price.Open
    Else
        DayOpen = Single.NaN
    End If
    DayLow = Price.Low
	Days += 1
	SinceOpen = 0
End If
If SinceOpen >= Expiration Then
	DayOpen = Single.NaN
End If
DayLow = System.Math.Min(DayLow, Price.Low)
If Days >= 2 Then
    If Price.Last > DayOpen AndAlso _
        Price.Last(1) <= DayOpen Then
        Pass
    End If
Else
    SetIndexInvalid
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
caution
Posted : Thursday, January 17, 2013 3:10:46 PM
Registered User
Joined: 5/5/2010
Posts: 185

Its not working for me, for example BA gapped down and opened @ $72.78 and traded higher on the first bar.  I'm not getting a signal, what am i doing wrong?

caution
Posted : Thursday, January 17, 2013 3:25:49 PM
Registered User
Joined: 5/5/2010
Posts: 185

I got it.....thanks for your help!

Bruce_L
Posted : Thursday, January 17, 2013 3:35:43 PM


Worden Trainer

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

I am happy to read you were able to figure it out.



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