Hello,

I would like to code some sort of chandelier trailing stop (not the built-in ATR trailing stop) and the stop line will trail the HHV since the actual buying date. The sell instruction will then be generated based upon the stop line. The code is something like the following:

Stop_Line=HHV(High,BarsSince(Buy))-2.5*ATR(14);
Sell=cross(close,Stop_Line);

However, the excessive buy signals will reset the
BarsSince(Buy) value and shift the stop line. I know the excessive buy signals can be removed by code the following code:
buy = ExRem( buy, sell );

But the ExRem() function will require sell value which will rely on correct stop line.

Stop line --> Sell signal --> remove excessive buy signals --> get actual buy signal --> get correct Stop line --> dead loop

Would anybody help me to lock in the actual buying date.
Your help is highly appreciated.

Best Regards,

Darwin Ding









__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to