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

[amibroker] Detecting Cause Of Trade EXIT Signal - Help !



PureBytes Links

Trading Reference Links

Yuki,

This looks like a simple syntax issue:

IIf(PrimeA, AddColumn(13000000 / Close, "Shares", format = 1.0),
AddColumn(10000000 / Close, "Shares", format = 1.0));

would be

AddColumn(
    IIf(PrimeA, 13000000 / Close, 10000000 / Close),
    "Shares", 1.0
    );

You don't need the "format = ", btw. Hope it helps.

Gordon

--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> I'm having trouble, as usual.  ^_-
> 
> I run a "night-before" scan to identify setups.  I also have it give
> me a rough idea of share amounts should a setup trigger.
> 
> The line was:
> 
> AddColumn(10000000 / Close, "Shares", format = 1.0);
> 
> This worked fine, and still does, but now I've added a bit of
> complexity to the situation, and I can't come up with the right new
> statement.
> 
> I have a period of time during the month I call 'PrimeA'.  Positions
> size would be larger during that time than during other times.  I
> don't define PrimeA in the exploration, because I'm needing to look
> ahead to the next trade day, and there would be holidays to 
consider,
> and I think floating holidays, which we now have in Japan, would
> break the code.  It could probably still be done by somebody with a
> great mind, but I did not think that I had to do it.
> 
> I thought I could just establish a variable PrimeA, and set it to
> either true or false each time I ran the code.  I would know of
> course whether the next trade day was in the PrimeA time period or
> not.
> 
> Then:
> 
> IIf(PrimeA, AddColumn(13000000 / Close, "Shares", format = 1.0),
> AddColumn(10000000 / Close, "Shares", format = 1.0));
> 
> But, no matter how I establish PrimeA: (PrimeA = False; PrimeA = 0;
> PrimeA = True; PrimeA = 1;) I get the same position size in the
> column "Shares".  It always gives me a share amount as if PrimeA 
were
> perpetually true.
> 
> Obviously, I am not a programmer, and I do not *think* like a
> programmer.  Can anyone who is, or does, help?  ^^_^^
>  
> Best,



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

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:
    http://docs.yahoo.com/info/terms/