PureBytes Links
Trading Reference Links
|
Hello Sam,
hope there are no typos this time :-) try this approach:
Pos = Flip(Buy,Sell);
Temp = HighestSince(Buy,H);
Temp = ValueWhen(Sell,Temp ,0);
Temp = IIf(pos, Temp , Null);
BestSellPrice = Ref(Temp ,-1);
Plot(C,"C",1,128);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),5);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),4);
Plot(BestSellPrice ,"BestSellPrice",5,styleStaircase);
I think this assumes you enter at the open...
best regards,
herman
-----Original Message-----
From: qweds_560 [mailto:qweds_560@xxxxxxxxx]
Sent: Tuesday, January 18, 2005 6:23 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Best exit price?
Hello,
I have been trying to solve this problem for some time using all
sorts of functions in the backtester: HHV, barssince, valuewhen,
barindex and so on.
Consider a simple stop and reverse system. I want to know what the
best exit price could have been from a long position before the
system reverses and what the best exit price that could be from a
short position before the system reverses and goes long.
To put it another way, I would like to peek into the future to see
what the best price I could exit my position at BEFORE I receive a
signal in the opposite direction.
I am trying to find out the maximum profit that could be made using
the system if you had the foresight to know exactly when to exit
each and every position.
I would be grateful for any suggestions.
Many thanks
Sam
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|