StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 2 3 4 5 6 ... 10 >>Post Follow-up
TheRumpledOne
6,358 posts
msg #36421
Ignore TheRumpledOne
6/23/2005 9:56:32 AM

Newcomers, you may want to read the entire thread.


TheRumpledOne
6,358 posts
msg #37243
Ignore TheRumpledOne
8/2/2005 7:47:33 AM

POP TO THE TOP


glgene
523 posts
msg #37247
Ignore glgene
8/2/2005 8:41:50 AM

Does SF scripting accept IF-THEN-ELSE statements?

GL Gene


glgene
523 posts
msg #37253
Ignore glgene
8/2/2005 9:23:26 AM

I had written this earlier, but somehow it disappeared?? Anyway, here is my question: Can you use "IF-THEN-ELSE" logic in SF scripting?


alf44
2,025 posts
msg #37933
Ignore alf44
9/13/2005 6:37:22 PM

RumpledOne,

I've been trying (unsuccesfully) to use your "logic" stuff to experiment with a chart set-up I'm playing around with.

Please HELP !

I'm trying to identify areas of "congestion" on a chart. I'm defining "congestion" as a minimum of 5 daily bars...made up of a "Measuring Bar" and followed by (at least) 4 subsequent bars whose Open OR Close falls within the High/Low Range of that "Measuring Bar".

It it possible to use your logic system (or anything else) to achieve this ?

Any help you or others can give would be appreciated ! tia


alf44





TheRumpledOne
6,358 posts
msg #37936
Ignore TheRumpledOne
9/13/2005 7:59:09 PM

I've been trying (unsuccesfully) to use your "logic" stuff to experiment with a chart set-up I'm playing around with.

Please HELP !

I'm trying to identify areas of "congestion" on a chart. I'm defining "congestion" as a minimum of 5 daily bars...made up of a "Measuring Bar" and followed by (at least) 4 subsequent bars whose Open OR Close falls within the High/Low Range of that "Measuring Bar".

It it possible to use your logic system (or anything else) to achieve this ?

Any help you or others can give would be appreciated ! tia

Fetcher[
set{Hi5, high 5 days ago}
set{Lo5, Low 5 days ago}

set{HiGTop, count(Hi5 above open, 4)}
set{LoLTop, count(Lo5 below open, 4)}
set{HiGTcl, count(Hi5 above close, 4)}
set{LoLTcl, count(Lo5 below close, 4)}

add column HiGTop
add column LoLTop

add column HiGTcl
add column LoLTcl

add column Hi5
add column Lo5
add column open
add column close

add column open 1 day ago
add column close 1 day ago

add column open 2 days ago
add column close 2 days ago

add column open 3 days ago
add column close 3 days ago

add column open 4 days ago
add column close 4 days ago

close above 1
volume above 100000

sort column 5 descending
]



This should put you in the ball park... however, I am not sure if Hi5 and Lo5 are getting recalculated or not in the count statements... in other words, when it counts is it using Hi5 for today when in counts back or it is using Hi5 1 day ago, Hi5 2 days ago, etc... A little help here StockFethcer.

MAY ALL YOUR FILLS BE COMPLETE.







TheRumpledOne
6,358 posts
msg #37937
Ignore TheRumpledOne
9/13/2005 8:34:47 PM

Fetcher[


set{Hi5, high 5 days ago}
set{Lo5, Low 5 days ago}

set{HiGTop0, count(Hi5 above open, 1)}
set{LoLTop0, count(Lo5 below open, 1)}
set{HiGTcl0, count(Hi5 above close, 1)}
set{LoLTcl0, count(Lo5 below close, 1)}

set{xa0, HiGTop0 + LoLTop0}
set{xb0, HiGTcl0 + LoLTcl0}
set{xc0, xa0 + xb0}
set{hits0, count(xc0 above 0, 1)}

set{HiGTop1, count(Hi5 above open 1 day ago , 1)}
set{LoLTop1, count(Lo5 below open 1 day ago , 1)}
set{HiGTcl1, count(Hi5 above close 1 day ago , 1)}
set{LoLTcl1, count(Lo5 below close 1 day ago , 1)}

set{xa1, HiGTop1 + LoLTop1}
set{xb1, HiGTcl1 + LoLTcl1}
set{xc1, xa1 + xb1}
set{hits1, count(xc1 above 1, 1)}

set{HiGTop2, count(Hi5 above open 2 day ago , 1)}
set{LoLTop2, count(Lo5 below open 2 day ago , 1)}
set{HiGTcl2, count(Hi5 above close 2 day ago , 1)}
set{LoLTcl2, count(Lo5 below close 2 day ago , 1)}

set{xa2, HiGTop2 + LoLTop2}
set{xb2, HiGTcl2 + LoLTcl2}
set{xc2, xa2 + xb2}
set{hits2, count(xc2 above 2, 1)}

set{HiGTop3, count(Hi5 above open 3 day ago , 1)}
set{LoLTop3, count(Lo5 below open 3 day ago , 1)}
set{HiGTcl3, count(Hi5 above close 3 day ago , 1)}
set{LoLTcl3, count(Lo5 below close 3 day ago , 1)}

set{xa3, HiGTop3 + LoLTop3}
set{xb3, HiGTcl3 + LoLTcl3}
set{xc3, xa3 + xb3}
set{hits3, count(xc3 above 3, 1)}

set{HiGTop4, count(Hi5 above open 4 day ago , 1)}
set{LoLTop4, count(Lo5 below open 4 day ago , 1)}
set{HiGTcl4, count(Hi5 above close 4 day ago , 1)}
set{LoLTcl4, count(Lo5 below close 4 day ago , 1)}

set{xa4, HiGTop4 + LoLTop4}
set{xb4, HiGTcl4 + LoLTcl4}
set{xc4, xa4 + xb4}
set{hits4, count(xc4 above 4, 1)}

add column hits0
add column hits1
add column hits2
add column hits3
add column hits4

add column Hi5
add column Lo5
add column open
add column close

add column open 1 day ago
add column close 1 day ago

add column open 2 days ago
add column close 2 days ago

add column open 3 days ago
add column close 3 days ago

add column open 4 days ago
add column close 4 days ago

close above 1
volume above 100000


sort column 5 descending

]




Brute force method....

But SF blows up.

This runs with Mozilla but blows up with IE.

But there is still more code.

There is probably a more elegant way of doing this, my brain is stuck at the moment... Cegis to the rescue!




alf44
2,025 posts
msg #37939
Ignore alf44
9/13/2005 10:03:16 PM

Hmmm...

First thanks for the quick reply and effort. It seems as though it's not quite there yet. If you add the 2 phrases:

and Draw Price Line at Hi5
and Draw Price Line at Lo5

...to the bottom of your 1st filter (then run the filter and pull-up the charts) you can see that what it is returning is just the High and Low of the Daily Bar 5 days ago.

I realize I'm prolly not being specific enough. I'm not even sure that the specificity that is needed for this is even possible with SF. I DO feel though that there may be something here worth exploring.

Thanks again for any help !


alf44







alf44
2,025 posts
msg #37940
Ignore alf44
9/13/2005 10:49:15 PM

again...

...I'm trying to isolate a "Measuring Bar" (ie. a day that is a minimum of five days ago) whose High is HIGHER than EITHER the Open OR Close for EACH of the subsequent 4 days...AND...whose Low is LOWER than EITHER the Open OR Close for EACH of the subsequent 4 days. As long as the Open OR Close of the subsequent 4 days falls within the High/Low Range of the "Measuring Bar Day" that's acceptable. Not necessarily looking for "inside days" subsequent to the "Measuring Bar" Day but they DO fit the criteria and are okay. If the High/Low Range of any of the subsequent 4 days is outside the High/Low Range of the "Measuring Day" that's okay too. As long as either the Open OR Close falls within the "Measuring Day" Range that's what I'm wanting.

Thanks again for any help !


alf44





nikoschopen
2,824 posts
msg #37949
Ignore nikoschopen
9/14/2005 5:36:05 AM

Alfy,

It seems like what ure really looking for is a "flag" or a "penant" formation. If so, try the following:

Fetcher[
set{flag5, close 5 days ago / close 6 days ago}
set{flag4, close 4 days ago / close 5 day ago}
set{flag3, close 3 days ago / close 5 days ago}
set{flag2, close 2 days ago / close 5 days ago}
set{flag1, close 1 day ago / close 5 days ago}
set{flag, close / close 5 days ago}

flag5 is above 1.04
flag4 is between 0.96 and 0.99
flag3 is between 0.96 and 0.99
flag2 is between 0.96 and 0.99
flag1 is between 0.96 and 0.99
flag is between 0.96 and 0.99

price between 1 and 100

add column flag5 {Flag Pole}
add column flag4 {Day 5}

add column flag3 {Day 4}
add column flag2 {Day 3}
add column flag1 {Day 2}
add column flag {Today}
]




*Here, we're filtering out for those that make a one day pop of over 5% or more, followed by five closes (incl. today) all trading within the daily range 5 days ago (AKA "flag pole").

**This filter should work in most cases. However, when the flag pole is established by a large gap, any of the subsequent days could drop below the low of the gap day. This is because the low registered on the gap day is actually inside the 3% range I have designated for the subsequent days.


StockFetcher Forums · General Discussion · A COMPLETE LOGIC SYSTEM - ANOTHER GIFT FROM AVERY<< 1 ... 2 3 4 5 6 ... 10 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus