Hi there I have built a backtesting script in AFL for going LONG with stocks - it appears to be working. (I am very pleased with the ability to set the PositionSize dynamically based on the ATR of the current stock.)
When a long position is performing well, I want to be able to check for "retreating profit" and add an extra condition to the SELL command. For example, if 40% profit has been made on this position, I want to sell the stock if profit then retreats back to 20%. I am not clear how to do this. How do I ask if we are currently Long? Is it possible to find out in AFL the current gain on a long position? How can I ask "what is the highest Close since I went Long on this stock?" Many thanks for any suggestions on how to do this! -Andy (aka Fog)
