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

Re: [amibroker] Re: Is it possible to create such a buy signal ?



PureBytes Links

Trading Reference Links

Hello,

> The only little glitch I noticed is that when it sells on a profit, 
> it correctly report a +0.5% profit, but when it sells on a losse, it 
> systematically reports a -0.1% instead of -0.50%.
> 
> Any clue why ?

There is one '9' digit too much ( 0.9995 instead of 0.995) in the condition2,
the corrected version is:

sell2cond = low < buyprice * 0.995; // -0.5% from buyprice

sellprice = IIF( sell1cond, buyprice * 1.005, IIF( sell2cond, 
buyprice * 0.995, close ) );


Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com