[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] AddTo Composite



PureBytes Links

Trading Reference Links


On Jul 18, 2007, at 12:40 PM, Ara Kaloustian wrote:
I have been using ATCs on a daily basis for quite some time...
 
I wrote a couple of new ones, but having a lot of trouble with them. They run through the code properly, but do not write to disk reliably. The do write on occasion, but I can not determine under what circumstances. Older ATCs still function fine!
 
I do use "refreshAll" to check if ATC were updated on symbol tree..
 
 
 
Anyone else with similar experiences? 

Ara,

I don't know if it is related, but I noted a possible anomaly in ATC writing (or a bug in my AFL) in the simple code I recently posted:

I did not get any replies about my questions in the post.  I have included it again here so you won't have to look it up.

Dennis


Subject: Manual markers for charts --code included and a question

Hello,

I wanted to be able to enter trades manually --representing the ideal
discretionary system trades for comparing different automated systems
trying to mimic them.  I combined several different ideas I found
here to make the code below.

To operate, you select a name, make an empty ticker, then enable
manual trades, select a bar and place a marker on it.

It remembers the markers and can display them on any chart.  The same
idea could be used to mark universal things on a chart such as
options expirations, fed announcements, 9-11, other market moving
news that would affect all charts in back testing.  It could also be
modified to switch files 1-1 for each current ticker for ticker
specific events.  The advantage is that the data is retained across
different panes etc. --unlike drawn studies which can not be shared,
cut, pasted, and could easily be lost.

So far, I have noticed a couple anomalies in operation that I can't
explain.
The first time I enter a marker after starting AB, it seems to
disappear after a bit and has to be reentered once.
It lost my markers once, and I am not sure why that happened --the
files were still there.
Also, I wanted to have a way to make it hard to clear all the markers
by mistake.  I was looking for a way to require the shift key down
when clicking on the make empty ticker button as a fail safe.  Or
perhaps there is a way to make a confirmation dialog box.

I would appreciate any help with these issues and comments for
improvements.

You make take the following code and use it or post it however you
like as far as I am concerned.

~Dennis

_SECTION_BEGIN("Manual Trades");
// 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 saveManual(array, ManName)
{AddToComposite(array ,ManName ,"x",atcFlagEnableInIndicator|
atcFlagDefaults);}

function saveAllManual(BuyMan, SellMan, ShortMan, CoverMan, ManName)
{
saveManual(BuyMan , ManName+"1");
saveManual(SellMan , ManName+"2");
saveManual(ShortMan , ManName+"3");
saveManual(CoverMan , ManName+"4");
}

ManualName = ParamStr("Manual Trade Ticker", "~Kezha");
createManual = ParamTrigger("Make Empty Ticker", "Make Empty Ticker" );
EnableManual = ParamToggle("Enable Manual Trades", "OFF|ON" );
setbuy = ParamTrigger("Buy", "Buy" );
setsell = ParamTrigger("Sell", "Sell" );
setshort = ParamTrigger("Short", "Short" );
setcover = ParamTrigger("Cover", "Cover" );
clear = ParamTrigger("Clear", "Clear" );

bi = BarIndex();
sbi = SelectedValue( bi )-bi[0];

if( createManual )
{
saveAllManual(0, 0, 0, 0, ManualName);
}

if( enableManual )
{
BuyMan = Foreign(ManualName+"1" ,"c");
SellMan = Foreign(ManualName+"2" ,"c");
ShortMan = Foreign(ManualName+"3" ,"c");
CoverMan = Foreign(ManualName+"4" ,"c");

if( setbuy ){BuyMan[sbi ] = 1; saveManual(BuyMan , ManualName+"1");}
if( setsell ){SellMan[sbi ] = 1; saveManual(SellMan, ManualName+"2");}
if( setshort ){ShortMan[sbi ] = 1; saveManual(ShortMan, ManualName+"3");}
if( setcover ){CoverMan[sbi ] = 1; saveManual(CoverMan, ManualName+"4");}
if( clear )
{
BuyMan[sbi ] = 0;
SellMan[sbi ] = 0;
ShortMan[sbi ] = 0;
CoverMan[sbi ] = 0;
saveAllManual(BuyMan, SellMan, ShortMan, CoverMan, ManualName);
}
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);
}
_SECTION_END();


__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___