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

[amibroker] Re: Problem with ExRem?



PureBytes Links

Trading Reference Links

I think I figured out a way around the problem without using a loop.

example code:
-------------
Buy=Ref(RSIOverSoldCond AND RSIBuyCond,-1);
BuyPrice=Ref(O,-BarsSince(Buy));
Sell=Cross(sellStop,L) OR Cross(H,target);
Buy = ExRem( Buy, Sell );
entryPrice=BuyPrice*Buy;
entryPrice=IIf(entryPrice==0,Ref(entryPrice,-BarsSince(entryPrice>0)),entryPrice);
SellPrice=IIf(Cross(sellStop,L),sellStop,entryPrice+10*pip);
Sell=Cross(sellStop,L) OR Cross(H,entryPrice+10*pip);
Sell= ExRem(Sell, Buy );
Buy = ExRem( Buy, Sell );
---------------
I think the best solution is to have the ExRem function fix the
BuyPrice array so it is consistent with the 'corrected' Buy array.

Bill

--- In amibroker@xxxxxxxxxxxxxxx, "gp_sydney" <gp.investment@xxx> wrote:
>
> By my understanding, BuyPrice is just an array of prices based on your
> buy price selection (High, Low, Close, etc) and doesn't have anything
> to do with your actual buy signals. I think you need to include some
> way of using the BuyPrice value from the bar of the last Buy signal,
> not just the current bar's buy price.
> 
> Which may need a loop since you have redundant buy signals.
> 
> Regards,
> GP
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "bilbo0211" <bilbod@> wrote:
> >
> > I am having a problem with a back testing formula.
> > 
> > ExRem removes extra Buy/Sell signals but does not adjust the BuyPrice
> > for the removed signals.
> > 
> > For example, I have a target based on the BuyPrice.
> > 
> > A Sell condition depends on the BuyPrice,
> > 
> > sellCond1=Cross(H,BuyPrice+x);
> > 
> > It does not work as expected because it is using BuyPrices associated
> > with Buy's that were removed for some targets.
> > 
> > Is there a way around this problem?
> > 
> > Bill
> >
>




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
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/