PureBytes Links
Trading Reference Links
|
Hi Tomasz,
Thanks for looking at my post --and sorry for my lack of AFL detail.
I take it from your initial response that what I am observing is not
the expected behavior.
The following AFL (below) produces the behavior I described. If I
stay in Time bar mode, all is well. However, after marking one or
more bars and switching the chart to volume or range bars, I get the
undesirable behavior detailed below.
I am also attaching 3 screenshots to this email (it won't show up on
the forum), that show what I am seeing.
Best regards,
Dennis
Time Bars:
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Range Bars:
Volume Bars:
//
//Test of ATC/Foreign with manual markers 8/30/2007 Dennis Brown
//
Version(4.99); //minimum version required
function StaticArraySet(VarName,array){AddToComposite
(array ,"~SA_"+VarName ,"X",atcFlagEnableInIndicator|atcFlagDefaults);}
function StaticArrayGet(VarName){return Foreign("~SA_"+VarName,"H");}
_SECTION_BEGIN("Manual Markers"); //sections here are just to arrange
parameters in UI groups
// Manual Trade Markers
// This section allows manual trades to be entered and saved
permenantly as a ticker
// ~name1 is Buy flags
// ~name2 is Sell flags
// ~name3 is Short flags
// ~name4 is Cover flags
function saveAllManual(ManName, BuyMan, SellMan, ShortMan, CoverMan)
{
StaticArraySet(ManName+"1",BuyMan );
StaticArraySet(ManName+"2",SellMan );
StaticArraySet(ManName+"3",ShortMan );
StaticArraySet(ManName+"4",CoverMan );
}
//
ManualName = ParamStr("Manual Trade Ticker", "Kezha");
//
if(ParamTrigger("*** Make Empty Ticker", "Click to Empty Ticker"))
{
saveAllManual(ManualName, 0, 0, 0, 0); //do the bad thing
PopupWindow("Blank Ticker Created", "ALL Manual Trades Cleared",
timeout = 5, left = -1, top = -1 ); // let the user know you did it
}
// Trigger markers
setbuy = ParamTrigger(". Buy", "Mark Bar Buy" );
setsell = ParamTrigger(". Sell", "Mark Bar Sell" );
setshort = ParamTrigger(". Short", "Mark Bar Short" );
setcover = ParamTrigger(". Cover", "Mark Bar Cover" );
clearBar = ParamTrigger(". Clear", "Clear Bar" );
//
bi = BarIndex();
sbi = SelectedValue( bi )-bi[0];
BuyMan = StaticArrayGet(ManualName+"1");
SellMan = StaticArrayGet(ManualName+"2");
ShortMan = StaticArrayGet(ManualName+"3");
CoverMan = StaticArrayGet(ManualName+"4");
if(setbuy){BuyMan[sbi] = 1; StaticArraySet(ManualName+"1",BuyMan );}
if(setsell){SellMan[sbi] = 1; StaticArraySet(ManualName+"2",SellMan);}
if(setshort){ShortMan[sbi] = 1; StaticArraySet(ManualName
+"3",ShortMan);}
if(setcover){CoverMan[sbi] = 1; StaticArraySet(ManualName
+"4",CoverMan);}
if(clearBar)
{
BuyMan[sbi] = 0;
SellMan[sbi] = 0;
ShortMan[sbi] = 0;
CoverMan[sbi] = 0;
saveAllManual(ManualName, BuyMan, SellMan, ShortMan, CoverMan);
}
PlotShapes(BuyMan * shapeUpArrow,colorGreen,0,L,-25);
PlotShapes(SellMan * shapeDownArrow ,colorRed ,0,H,-25);
PlotShapes(ShortMan * shapeHollowDownTriangle ,colorRed ,0,H,-25);
PlotShapes(CoverMan * shapeHollowUpTriangle,colorGreen,0,L,-25);
Plot(C ,"Price",colorBlue,styleBar);
// quick and dirty trading day start and end markers
Plot( TimeNum()>=160000 AND Ref(TimeNum(),-1)<160000 , "",
colorRed,styleOwnScale|styleNoLabel|styleDashed|styleHistogram);
Plot( TimeNum()>=93000 AND Ref(TimeNum(),-1)<93000, "",
colorGreen,styleOwnScale|styleNoLabel|styleDashed|styleHistogram);
_SECTION_END();
On Aug 30, 2007, at 5:33 PM, Tomasz Janeczko wrote:
Hello,
You don't provide the code you are using. The discussion is
pointless without it.
It is unknown if you are using Foreign or SetForeign, TimeFrameSet
to get range bars
or chart is set to range mode. There are too many unknowns to give
you any answer.
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Dennis Brown" <see3d@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, August 30, 2007 9:58 PM
Subject: Re: [amibroker] Need help understanding ATC/Foreign
subtleties
Another clue comes to light.
The odd behavior of the range bars only happens if the flag bar value
("1") is greater than the value of the bar range. So what I guess is
happening is that my first "1" bar is seen as exceeding the range
limit and produces a first "range" bar and the next "0" produces a
second "range" bar. Everything from the beginning of the ticker to
the first "1" is called one "range" bar with a start time and end
time that covers a whole lot of time. In other words, foreign reads
in my flags as if it were a stock and converts it to range bars
first, then tries to align the bars to the native ticker.
Since I do not see any use for this mode of behavior, if nobody
objects, I will make a formal request for the foreign (volume or
range bars mode) to behave in the following useful way (which is what
I had originally thought would be the case).
The native bars would be the "template" and the foreign function
would combine, pad and align bars to create 1 for 1 bars based on
native bar time stamps. That way any "real" tickers or indicators
that are read in with foreign can be compared directly to the bars of
the native ticker.
I have yet to get a flag bar to show up in volume bar mode (even when
I supplied all bars with lots of fake volume), but the modified
behavior of foreign above should fix that also.
Dennis
On Aug 30, 2007, at 12:39 PM, Dennis Brown wrote:
I partially figured out one piece of the puzzle. I was reading the
"C" value which would be "0" unless the 5 second bar matched up to
the end of the larger timeframe bar. Changing to reading the "H"
value made it work for higher minute timeframes now. However, the
behavior did not change for volume bars (none) or range bars (too
many).
Dennis
On Aug 30, 2007, at 11:51 AM, Dennis Brown wrote:
Hello AFL experts,
I am having a hard time understanding a few things about ATC/
Foreign
relating to time stamps on bars and I am hoping someone can
clear up
a few things for me.
For instance:
I am running a 5 second database, and I created an ATC ticker with
one bar ("X" field) marked as "1" (True), all other bars are
marked
as "0" (False).
I then read the ATC ticker in with foreign and plotted a marker for
any "1" bar and it worked as expected.
However:
If I change the chart (not the database) to displaying 1 minute
bars,
foreign no longer reads in a "1" bar anywhere.
If I change to volume bars, foreign no longer reads in a "1" bar
anywhere.
If I change to range bars, foreign reads a "1" bar everywhere up to
the time stamp of the actual "1" bar, then "0" for bars after that.
What I am trying to accomplish, is to have ATC "flags" that are
time
stamped to a 5 second database, that are then read into any other
chart timeframe and will show up as a flag on the bar that contains
that original time stamp. (It is for marking manual trade signals
among other things)
Please enlighten me.
Thanks,
Dennis
|