cces
> to INDIVIDUAL values.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> - Original Message -
> From: "Graham Johnson" <[EMAIL PROTECTED]>
> To:
> Sent: Sunday, January 27, 2008 8:00 AM
> Subject: [amibroker] Re: Identify bar for actual
January 27, 2008 5:00 PM
Subject: [amibroker] Re: Identify bar for actual Buy
>
> Tomasz,
>
> Tomasz,
>
> Why did you design an array-processing language and not allow
> functions to be first-class?
>
> Then, you could have wonderful things like APPLY and MA
For" loop and array subscript operator [] gives you acces
> to INDIVIDUAL values.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> - Original Message -
> From: "Graham Johnson" <[EMAIL PROTECTED]>
> To:
> Sent: Sunday, January 27, 2008 8:0
and array subscript operator [] gives you acces
to INDIVIDUAL values.
Best regards,
Tomasz Janeczko
amibroker.com
- Original Message -
From: "Graham Johnson" <[EMAIL PROTECTED]>
To:
Sent: Sunday, January 27, 2008 8:00 AM
Subject: [amibroker] Re: Identify bar for actual
> vaInitStop = 0;
> vaInitStop = IIf(((Buy == 1) AND (Ref(vaInitStop, -1) == 0)) ,
BuyPrice - (Ref(vaIStopVal, -1)), Ref(vaInitStop, -1));
AFL array maths doesn't allow you to have iterative statements like
that. In the definition of vaInitStop, you're trying to base it on the
value of the same v
Remember that variables like ATR(period) are arrays.
Try something like:
StopPrice=BuyPrice - Ref(vaIStopVal, -BarsSince(Buy));
That will subtract the constant value of vaIStopVal on the Buy bar
from the BuyPrice so the StopPrice will be the same for every bar
since the Buy bar.
Bill
--- In ami
Hi
The bottom line with this is that I want to be able to set a stop and
have control over it.
After thinking it through, I decided that the first step was to set
the stop for the first Buy signal and keep it at the same value until
a Sell signal and then set it to 0 again.
Seemed like a grea
Hehe this is exactly what I'm looking for too in my previous post :)
Hope we find a solution!
--- In amibroker@yahoogroups.com, "Graham Johnson" <[EMAIL PROTECTED]> wrote:
>
> I'm sure that a solution for this has been on the forum, but - after
> much searching..
>
> Code is for a Long syste