Hello all,I couldn't be more pleased with all the Amibroker
improvements lately, I am still often amazed what this fantastic piece
of software is capable of.
I am going wrong somewhere with the loop sample below when changing
the expression: Close[ i ] > priceatbuy * 1.2 ) into: Close[ i ] <
priceatbuy * 0.8 )
First expression works fine, with the second one things go wrong and I
can't figure what! Can someone send me in the right direction pls.
Are there any other ways to refer to the Entry Price other than
Valuewhen and Equity Flip(Buy,Sell)?
Cheers,
Adrian
Buy = Cross(C,EMA(C,50));
Sell = 0;
priceatbuy = 0;
for( i = 1; i < BarCount; i++ )
{
if( priceatbuy == 0 AND Buy[ i ] )
{
priceatbuy = BuyPrice[ i ];
}
else Buy[ i ] = 0;
if( priceatbuy > 0 AND Close[ i ] > priceatbuy * 1.2 )
{
Sell[ i ] = 1;
priceatbuy = 0;
}
}