PureBytes Links
Trading Reference Links
|
These are some quick off the top of head examples that may help you
seek your own solution.
You would have to set a single condition for the buy signal, and then
apply the second confirmation signal to hold that trade in the sell
condition, as a negative of the condition true.
Buy = condition1;
Sell = SellConditions or HoldCondition==0;
The HoldCondition would include that the buy was made on the smae day
eg
HoldCondition = ConditionsRequiredToHold and valuewhen(buy,datenum())==now(3);
You also want ot include a volume in your sell statemant
SumVolume = sum(v,barssince(datenum()!=ref(datenum(),-1)+1) ;
VolumeCondition = valuewhen( Cross(timenum(),160000),SumVolume) <
Valuewhen( cross(timenum(),113000), sumvolume) *1.3;
Sell no becomes something like
Sell = SellConditions or HoldCondition==0 or HoldCondition;
On 7/25/05, acesheet <acesheet@xxxxxxxxx> wrote:
> Hello.
>
> I would like the backtester to buy if a certain condition exists at
> all on any given day, but exit the same day if a confirmation signal
> doesn't occur by EOD.
>
> Here's the example:
>
> Buy=Cross(V,0.31*Ref(V,-1)*1.1) and Cross(H,Ref(H,-1));
> Sell=Cross(L,Ref(L,-1));
>
> I'd also like to sell the same day if volume doesn't exceed the
> prior day's volume. However, I don't want the system to exit on that
> condition all the time only on the first day of the trade. In other
> words I want to enter on a price and volume signal, but stick with
> the trade only if I have confirming volume. I would sell at the
> close of the day.
>
> What I'm trying to do is simulate receiving an intraday signal by
> about 11:30 AM of volume that will likely rise below the day before
> (about 31% of the trading day), but exit if the volume doesn't
> actually do what I want or what it looked like it was going to do.
>
> I'm sure this can be done, but I can't find a variable that tells me
> how many days I'm in a trade.
>
> How can I program this? Do I need to enable "Same Day Exits" to do
> this?
>
> Sincerely,
>
> -ace
>
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
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 other support material please check also:
http://www.amibroker.com/support.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/
|