| Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 9/30/2006 Posts: 317
|
I need help creating a strategy for
BUY If the stock gaps down at morning open and sell when the price fills the gap.
SELLSHORT If the stock gaps up at the morning open and buy to cover when gap is filled.
Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
How are you defining a Gap Down at Open (I have seen it defined as both previous Low to current Open and previous Close to current Open)?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 9/30/2006 Posts: 317
|
Previous close to current open and applies to both minute and daily bars. from previous day to current day. Thanks in advance...
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There are four RealCode Conditions below which are designed for use on an intraday Chart. Each starts with its own header and uses the purpose of the Condition as its name. The Sell and Cover Rules trigger based on closing only the most recent Gap. You will want to give the Sell and Cover Rules higher Priority than the Buy and Sell Rules if you use them in a BackScan.
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Buy
'|******************************************************************
If Price.Open < Price.Last(1) AndAlso _
Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then Pass
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Sell
'|******************************************************************
Static Prev As Single
If isFirstBar Then
Prev = Single.NaN
Else If Price.DateValue.DayOfYear <> _
Price.DateValue(1).DayOfYear AndAlso _
Price.Open < Price.Last(1) Then
Prev = Price.Last(1)
End If
If Price.High > Prev Then
Pass
Prev = Single.NaN
End If
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Short
'|******************************************************************
If Price.Open > Price.Last(1) AndAlso _
Price.DateValue.DayOfYear <> Price.DateValue(1).DayOfYear Then Pass
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 4.9 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Cover
'|******************************************************************
Static Prev As Single
If isFirstBar Then
Prev = Single.NaN
Else If Price.DateValue.DayOfYear <> _
Price.DateValue(1).DayOfYear AndAlso _
Price.Open > Price.Last(1) Then
Prev = Price.Last(1)
End If
If Price.Low < Prev Then
Pass
Prev = Single.NaN
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/29/2005 Posts: 885
|
Bruce...if you wanted to add to the sell/buy to cover rules, a time based rule which said to sell in " x" many days if a gap hasnt been filled, how would you order this in your rules list.. Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
SILVERWESOKE,
I would probably but them above the Buy and Short Rules (but their priority versus the Sell and Cover Rules doesn't make any difference). That said, since the Buy and Sell Short Rules can only trigger on the first Bar of the day, a Trade Length Rule to Exit All with a length set so it couldn't trigger on the first Bar of the day would not interact with the Buy and Short Rules at all (so the Priority wouldn't matter in this case).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/29/2005 Posts: 885
|
Actuallly I was thinking about using it on daily bars...so it probably wouldnt impact much then..Just put it before the buy and Short rules yes?
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
SILVERWESOKE,
Yeah. If you are going to use Daily Bars (it should be noted that the Rules are designed for use on an intraday Chart), definitely put it before the Buy and Short Rules.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |