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

RE: [amibroker] If last trade was a loss, Skip trades in same direction as the loss


  • Date: Thu, 19 Nov 2009 11:12:10 -0500
  • From: Rajiv Arya <rajivarya87@xxxxxxxxxxx>
  • Subject: RE: [amibroker] If last trade was a loss, Skip trades in same direction as the loss

PureBytes Links

Trading Reference Links



you might be able to skip the backtester
Essentially check the change in the equity curve between the last trade and current trade opportunity
 
Wrote this in an email so check for syntax
 
e=equity(); // this is your equity curve
 
lasttrade=flip(buy,sell); //if last trade is a buy then lasttrade =1 and stays  1 until a sell comes in
buy=buy and ((lasttrade and (e>valuewhen(buy,e,2)) or not(lasttrade));
sell=sell and ((not(lasttrade) and (e>valuewhen(sell,e,2)) or lasttrade));
 
Good luck

 

To: amibroker@xxxxxxxxxxxxxxx
From: anthonyanthony123@xxxxxxxxx
Date: Mon, 16 Nov 2009 14:27:33 -0800
Subject: [amibroker] If last trade was a loss, Skip trades in same direction as the loss

 
Hi Everyone....

I've been getting more comfortable with AFL and have begun trying to recode many of my TradeStation systems into AFL... I need some help using the custom backtester to accomplish this:

I want to track the last trade on a per symbol basis.  If the last trade on a specific symbol in the portfolio was a loser, I want to skip signals in the same direction as the losing trade until I get a signal in the opposite direction for the specific symbol.

Thanks in advance.




Windows 7: I wanted simpler, now it's simpler. I'm a rock star.

__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





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

__,_._,___