Gap Below (Above) Yesterday Low (High)
Author: memami5
Creation Date: 9/6/2014 10:59 AM
profile picture

memami5

#1
This is what I have :

Buy at the Market

Price crosses above Price from previous day
1-Price---Open
2-Price---low
---1

Also I was going to And it with

Price is Lower than it was a number of bars ago...

1-Price...open
Lockback period...1

and I chose Multiple....


What I am trying to do is to buy the stock if it Gaps down from previous day low and crosses above the low of yesterday.
profile picture

Eugene

#2
What does "crosses above the low of yesterday" mean? Today, the price gapped below the previous day (yesterday) low. Then, it crossed above that yesterday's low and you bought on a stop. Is that right? Otherwise please clarify your conditions in greater details; I don't quite understand them.

P.S. Have you tried the preinstalled and downloadable gap strategies?
profile picture

memami5

#3
is there any way I can call you on the phone? I am a serious trader ..If I don't get the help I have to look at different plat form for trading. I was very excited when I found you guys, but Fidelity people can't help, and I have to go to C# programming school to be able to use this system. The Gap fill program you have is for 8% Gap down and you buy it at the market, that is not what I want to do.

My program is very simple...If the stock opens Below yesterday low and crosses above yesterday Low, that is a trigger to buy.... Gap UP
....If the stock opens Above Yesterday Hi and Crosses Below yesterday Hi, that is a trigger short to buy...Gap Short

for example,AMZN for Gap UP

September 4th

O: 343.69
H:349.38
L:343.58
C:345.95

Sept. 5th
O: 346.30
H:346.83
L:342.50
C:346.38

not a very good example , because the open was above yesterday Low, but it drop below yesterday low and cross back above yesterday low, in my program this is a trigger to buy AMZN.

Eugene, I don't even mind learning to program, I just want to make sure you guys are serious in supporting down the road, other wise please let me know and I will switch to Interactive Brokers. thanks.
profile picture

LenMoz

#4
I've had good experience with WealthLab. Yes, there's a learning curve.
profile picture

Eugene

#5
QUOTE:
If the stock opens Below yesterday low and crosses above yesterday Low, that is a trigger to buy.... Gap UP
....If the stock opens Above Yesterday Hi and Crosses Below yesterday Hi, that is a trigger short to buy...Gap Short

I was confused about your rules and now it turns out that was for a reason. You're right, this example is not good because the order of events is not known.

On daily data where you're probably trying to apply the rules to, you can't know what occurred before: the drop below yesterday low OR the cross back above yesterday low. The order is not seen on the daily OHLC. Yes, the stock rebounded but what if there was (say) a mini M Top where it opened below 343.58 (say 343.5) for a couple of cents, crossed back 343.58 when you bought, then it plunged again even deeper to 342.50 (where you could've been stopped out depending on your exit strategy) and then rebounded all the way to 346.38 with you being out of the market?

Consequently, you need to switch to intraday data to realistically test these scenarios. The closest downloadable strategy is Significant gap buyer (intraday) and we'll take that as a starting point, adjusting its code to your rules and adding a simple exit at close (because I couldn't find any exit rules in your question):

CODE:
Please log in to see this code.


Copy and paste that into a new code-based strategy, then click "Execute".
profile picture

memami5

#6
Hi Eugene,


Good morning, thanks Body...i just didn't know how to communicate with the rules...sorry my bad. I copy and past your program, and compile it and it was okay, then I ran it for one stock for only one year for example SCTY...I didn't get any result. I am sure I am doing something wrong. I normally have one programm for Gap Up, and One for Gap Short and run it simultaneously on streaming Data, only for 25 stocks that I trade...my exist strategy it wearies, if falls bellow open of today, buy few cents...but if again if it is GOOGL, or PCLN i give it more wiggle room, other wise by the end of the day or next day (if i am using the Daily) and some times i use it on a weekly charts. I am looking forward to get this working that I could back test it.

I am heading to church for couple hours, to talk to my God, and pray to give me guidance, but as soon as I get back I will attack this again...I love Fidelity and if you guys really do the support this is going to be a great partnership.

Thanks again.
profile picture

Eugene

#7
Hi Mike,

There's one more step left. As I explained above, a strategy like that requires intraday data to perform correctly and without possible peeking. Consequently, if one runs it on Daily data and pays attention to the chart, he'd see the message stating: "For use on intraday data".

Please create an intraday DataSet (say 5-minute) for your 25 stocks, update it using the Data Manager > "Update Data (Price Only)", load up enough intraday bars to review historical trades and performance. In real time trading, you will get a result, i.e. a Buy/Short alert, on the second bar after market open.
profile picture

memami5

#8
Thanks Buddy, I will work with Fidelity people to get the mechanics correctly. I won't bother you with those kind of questions...I tried to down load your program "Significant Gap Buyer" that is written by you in 2011, but I couldn't find it...the only think that is in the folder is the "Gap Filler" written in 2007. I did down loaded my data, but still I feel handicap, since I am not able to get result ... What is the best way for me to learn a bit more?...that I could move around better? Should I take a class in C sharp? I bought a book on C# 5.0, by Joseph Albabari...is not bad, giving me a bit more understanding. Is the Drag and drop list that you have...dose it work? the first price i replaced it in my mind with the word Open, crosses above Price ( I replace it in my mind with Low) from previous day....dose this method works? and what is the last line I always use 1 because I only want to look at one bar (if I am running it daily)...Is there any way that I could call you for few Min. that I could get these small stuff out the way, and learn much quicker?

I saved the program that you send me and I am going to run it in real time...see what happens.

Thanks again.
profile picture

Eugene

#9
QUOTE:
I tried to down load your program "Significant Gap Buyer" that is written by you in 2011, but I couldn't find it

Instructions for Script Download
In Wealth-Lab client software, open the Strategy Explorer (Ctrl+O)
Click the "Download..." button
Click "Begin Download"

QUOTE:
Should I take a class in C sharp?

Please see the FAQ: How do I start with C# ?

QUOTE:
Is there any way that I could call you for few Min.

No. Support is not provided by phone/email.
profile picture

memami5

#10
Thanks I was able to down load all strategy from 2010, so I got that one...I am going to work on the programming...now I am going to work on back testing, to fix these strategy.

thanks.
profile picture

Eugene

#11
You don't need to modify the "Significant Gap Buyer". Simply run the code I gave you on intraday data. If that presents difficulties, I've come up with a version that runs on Daily data:

CODE:
Please log in to see this code.
profile picture

memami5

#12
Thanks Eugene, I ran this one for AAPL for I Minute date for one year, I got two shorts set ups, but I ran the one you sent me this morning, for up and down Gaps nothing?? so they are different? could you explain when you got a moment...

Thanks.
profile picture

Eugene

#13
The difference is that the first one requires intraday data, and the second strategy should be used on daily data. Feel free to explore the code. It's yours now!
profile picture

memami5

#14
Thanks Eugene,

I ran your strategy today...I want to fix it...It gave me a wrong result...GoogL triggered as short...but it never crossed the hi of yesterday...it fill the gap and took off...please see if you can change it a bit, it needs to cross the yesterday hi and then trigger, also, it gave me a wrong reading on GMCR...but that one is a tough one...I am working on it.

thanks...If you change it, please send me a copy of the new codes.
profile picture

memami5

#15
Also, it gave a wrong reading on TWTR...buy the way why aren't you on TWTR...the center of universe :-)
profile picture

Eugene

#16
Using the intraday version on 5-min intraday data by Google Finance, GOOGL indeed fired a Short signal because yesterday's high was 598.5 and today's open is 599.14. The next 5-min bar had a low of 598.5 so AtStop order triggered.

This scenario can be avoided by adding or subtracting a few ticks from the stop price e.g.
CODE:
Please log in to see this code.

or
CODE:
Please log in to see this code.
profile picture

memami5

#17
I got this error....error CS0103@(41,27): The name 'yHigh' does not exist in the current context...I used your second line...

profile picture

Eugene

#18
The modification was for the intraday system whereas you're trying to apply it to the EOD one.

CODE:
Please log in to see this code.


You'll figure out how to deal with long trades. Good luck.
profile picture

memami5

#19
Thanks. No I am running it at 9:30 am when the market opens...I still I don't understand why it triggered for TWTR...the hi of yesterday was 50.88...it never even touched that?
profile picture

Eugene

#20
QUOTE:
No I am running it at 9:30 am when the market opens...

Well, I'm getting used to repeat everything 2-3 times in your emails, support ticket and this thread:

You pasted the snippet into the wrong system, hence the compile error.
profile picture

memami5

#21
No, I don't think so...I don't do very well with people with attitude...if we can communicate and keeping respect for each other, let's do that...other wise you don't have to reply. I didn't post it in the wrong one. you made a mistake in your program, I was trying to help you fix it. You could say thank you. I was the only one found it since 2011 that you published it...the compile error was because you used the "y" in front of the word High...and I don't think your strategy still works...I was trying to help you, and bring it to your attention...
profile picture

Eugene

#22
The only strategy of the two I provided here that triggered a short on GOOGL was the first, intraday one (reply #5).

I did not make any typos. The "yHigh" was intentional. You pasted the line in the wrong code. You're telling me that instead of inserting that line in the first code, you're "fixing" an unmentioned, out-of-context downloadable strategy from 2011 that doesn't even need a fix because it simply doesn't implement your rules, and you're disclosing this fact only now? :)

Well, from now on please feel free to modify publicly available code on your own. I'm leaving this discussion because I've got to support our customers and to work on different projects. FYI, creating and tweaking custom coding solutions is not even a support item. Good luck with your ventures.