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

Re: [amibroker] counting setups and conditioning the buy on that count



PureBytes Links

Trading Reference Links

Yuki,

I'm not sure but the ATC statement may be a problem:

if  (TestMode==1)
{
Setups = AddToComposite(Setups, "~compSetups", "Close", flags =
atcFlagDefaults);
}

I think it should be:
Setups = AddToComposite(1, "~compSetups", "Close", flags = atcFlagDefaults);

so you add 1 to composite for esch setup you encounter
but you say the numbers look OK .... ???

Hope this works

A


----- Original Message ----- 
From: "Yuki Taga" <yukitaga@xxxxxxxxxxxxx>
To: "Ara Kaloustian" <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, January 31, 2006 2:39 AM
Subject: Re: [amibroker] counting setups and conditioning the buy on that
count


> Hi Ara,
>
> I cannot get this to make a trade.
>
> Here is what I have:
>
> Numerous variable declarations here ... then ...
>
> TestMode = 2; //TestMode 1 writes the ATCs
>
> // I just toggle to 1, then scan, and then toggle back to 2, and
> // then backtest
>
> if  (TestMode==2)
> {
> Setups = Foreign("~compSetups", "Close", fixup = 1);  // read ATC file to
see if you should trade
> }
>
> Here, I declare Setups as a variable, conditions which are also part of
the buy
> statement of course ...
>
> if  (TestMode==1)
> {
> Setups = AddToComposite(Setups, "~compSetups", "Close", flags =
atcFlagDefaults);
> }
> else
> {
>
> Buy = My normal rules AND TestMode == 2 AND Setups >= defined by me
> on the fly;
>
> Sell = 0;
> }
>
> I use an apply stop as an exit ...
>
> It *does* create a ~compSetups ticker, and the values look right.  But
> I cannot get it to trade now.
>
> Yuki
>
> Monday, January 30, 2006, 3:59:17 PM, you wrote:
>
> AK> I understand that you want to see how many stocks give you a setup on
any
> AK> given day. If you have a greater number of setups then a predetemined
value,
> AK> then you trade.
>
> AK> Looks like you need to do 2 passes.
> AK> 1. First pass to count the number of setups and store them in an ATC
file,
> AK> instead of trading.
> AK> 2. Modify your code so it reads the ATC file you just wrote and then
process
> AK> your normal trade conditions.
>
> AK> You can accomplish this by either modifying a couple of lines of code
to
> AK> change the operation or use a parameter to do the switching.
>
> AK> TestMode = Param("TestMode",1,1,2,1);  //TestMode 1 writes the ATCs
>
> AK> if  (TestMode==2)
> AK> {
> AK> Setups = Foreign(~ATC ... )  // read ATC file to determine if you
should
> AK> trade
> AK> }
>
>
> AK> Test code
> AK> ....
> AK> ...
>
> AK> if  (TestMode==1)
> AK> {
> AK> Setups = AddToComposite(...
> AK> }
> AK> else
> AK> {
> AK> Buy = ... your "normal" criteria and TestMode == 2 and Setups >= you
> AK> criteria for setups
> AK> Sell = ...
> AK> }
>
>
>
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 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/

<*> 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/