PureBytes Links
Trading Reference Links
|
hello IQFeed users,
I am making an attempt to remove spikes from the
price chart and I wonder if somebody thought about this and maybe solved it.
What I initially wanted to do is remove the spikes in the 1 minute domain by
using TimeFrameSet(in1Minute); and then do a TimeFrameRestore(); but this does
not work.
Below I added some code that removes spikes in the
1 Minute chart pretty good. However in the daily chart it makes errors. The
result for the QQQ's is acceptable but in the case for MTSX it removes data that
actually happened. That's why I would like to do the removal in the 1 minute
chart and convert this to the day chart. I do not know how to do this though
....
Hope someone has some ideas for me,
rgds, Ed
<FONT
color=#800000>for (i = <FONT
color=#ff00ff>1; i < <FONT
color=#000000>BarCount - <FONT
color=#ff00ff>1<FONT
color=#000000>; i++) { diff = <FONT
color=#0000ff>abs(<FONT
color=#000000>H[i+<FONT
color=#ff00ff>1] - <FONT
color=#000000>H[i-<FONT
color=#ff00ff>1]) / ((<FONT
color=#000000>H[i+<FONT
color=#ff00ff>1] + <FONT
color=#000000>H[i-<FONT
color=#ff00ff>1]) / <FONT
color=#ff00ff>2) * <FONT
color=#ff00ff>100<FONT
size=2>; cond1 = (<FONT
color=#000000>H[i] - <FONT
color=#000000>H[i-<FONT
color=#ff00ff>1]) / <FONT
color=#000000>H[i-<FONT
color=#ff00ff>1] * <FONT
color=#ff00ff>100 > diff * <FONT
color=#ff00ff>1.5<FONT
size=2>; cond2 = (<FONT
color=#000000>H[i] - <FONT
color=#000000>H[i+<FONT
color=#ff00ff>1]) / <FONT
color=#000000>H[i+<FONT
color=#ff00ff>1] * <FONT
color=#ff00ff>100 > diff * <FONT
color=#ff00ff>1.5<FONT
size=2>; <FONT
color=#800000>if (cond1 <FONT
color=#000000>AND<FONT
size=2> cond2) { <FONT
color=#000000>H[i] = (<FONT
color=#000000>H[i-<FONT
color=#ff00ff>1] + <FONT
color=#000000>H[i+<FONT
color=#ff00ff>1]) / <FONT
color=#ff00ff>2<FONT
color=#000000>; } diff = <FONT
color=#0000ff>abs(<FONT
color=#000000>L[i+<FONT
color=#ff00ff>1] - <FONT
color=#000000>L[i-<FONT
color=#ff00ff>1]) / ((<FONT
color=#000000>L[i+<FONT
color=#ff00ff>1] + <FONT
color=#000000>L[i-<FONT
color=#ff00ff>1]) / <FONT
color=#ff00ff>2) * <FONT
color=#ff00ff>100<FONT
size=2>; cond1 = (<FONT
color=#000000>L[i-<FONT
color=#ff00ff>1] - <FONT
color=#000000>L[i]) / <FONT
color=#000000>L[i] * <FONT
color=#ff00ff>100 > diff * <FONT
color=#ff00ff>1.5<FONT
size=2>; cond2 = (<FONT
color=#000000>L[i+<FONT
color=#ff00ff>1] - <FONT
color=#000000>L[i]) / <FONT
color=#000000>L[i] * <FONT
color=#ff00ff>100 > diff * <FONT
color=#ff00ff>1.5<FONT
size=2>; <FONT
color=#800000>if (cond1 <FONT
color=#000000>AND<FONT
size=2> cond2) { <FONT
color=#000000>L[i] = (<FONT
color=#000000>L[i-<FONT
color=#ff00ff>1] + <FONT
color=#000000>L[i+<FONT
color=#ff00ff>1]) / <FONT
color=#ff00ff>2<FONT
color=#000000>; } } <FONT
color=#0000ff>Plot(<FONT
color=#000000>C, <FONT
color=#ff00ff>"Price", <FONT
color=#000000>colorWhite, <FONT
color=#000000>styleCandle);
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|