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

Re: rembuy



PureBytes Links

Trading Reference Links

/****Definition of your Buy signal****/
Buy= Close>Avg_top_band AND (BarsSince(Lbw_trigger);
Buy= hold(buy==0,2) and buy;// one bar peak


/*****************************/
Entryprice= open;
StopPrice= L; 
StopLoss= -1//disable
Trailstop= -1;//disable
Target= ( C*1e10) : disable

ExitBin= Cross(70,Vrsi) ; 
Bars= 1 ; /*Sell if close is less than the buy price (the buy price 
being the open on the day following the buy signal*/


/* KEEP the oRDER++++*/
scRemBuyTrail(Buy,Entryprice,
StopPrice,StopLoss,TrailStop,
Target,ExitBin,Bars);

/* the dll returns the buy and the sell, all new buys that could 
occur during the trade are removed until the trade is finished*/

Buy=ref(Buy,-1); /*delayed one day*/
Sell=Sell;
BuyPrice=Entryprice;/*array*/
SellPrice=SellPr;/*array sellpr is given by the dll: next open if 
you choose exit on bar or exitbin */ 


/* below are charts*/
Entryprice=ValueWhen(Buy,Entryprice);
Stoploss=ValueWhen(Buy,StopLoss);
profit =ValueWhen(Buy,Target) ; 
Trail=HighestSince(Buy,Trailstop);

MaxGraph=14;
Plot(Close,"close",IIf( Buy, 6, IIf(Sell , 4 ,1 )),64);
Plot(Entryprice,"Ep",3,1);
//Plot(Stoploss,"stop",4,1);
//Plot(Profit,"Profit",7,1);
//Plot(TargetPr,"",6,1);
/* targetpr and trailpr are returned by the dll*/
//Plot(TrailPr,"TrailPr",5,1);
Plot(ValueWhen(Sell,SellPrice),"",2,1);

//Plot(Buy*10,"",6,2);
//Plot(Sell*5,"",7,2);

> Below is an excerpt from my original AFL. The reason I want to use 
> the rembuy.dll is because my formula tries to reference the actual 
> buy. However, if there is a raw buy signal after the actual buy but 
> before the trade is closed out, my formula starts referencing the 
> second, raw buy signal, which screws everything up.
> 
> I really only need the rembuy.dll because of my use of barssince
> (buy). 
> 
> Any suggestions to incorporate my AFL with rembuy.dll?
> 
> 
> 
> SetTradeDelays(1,1,1,1);
> /*SYNTAX SetTradeDelays( buydelay, selldelay, shortdelay, 
> coverdelay)*/
> BuyPrice = Open;
> SellPrice = Open;
> 
> Buy = Close>Avg_top_band AND (BarsSince(Lbw_trigger)
> <=trigger);
> 
> Sellstop = (BarsSince(Buy) != 1) AND (Close < ValueWhen(BarsSince
> (Buy) == 1, Open));
> /*Sell if close is less than the buy price (the buy price being the 
> open on the day following the buy signal) except if close on entry 
> day is lower than buy/open price, ignore*/
> 
> Sell = Cross(70,Vrsi) OR BarsSince(Buy)==default_exit OR Sellstop;
> 
> 
> Thanks.
> 
> Harold Harper
> harold@xxxx






  • References: