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

[amibroker] Re: Help with Scrip



PureBytes Links

Trading Reference Links


Hello,

Hope the following is something you can use.

PP = Ref(Avg,-1);
R1=(PP * 2) - Ref(Low,-1);
S1= (PP * 2) - Ref(High,-1);

BuyPrice=s1;
SellPrice=r1;
Buy=Cross(s1,L);
Sell=Cross(H,r1);

Good luck,
Stephen.

--- In amibroker@xxxxxxxxxxxxxxx, "Ernie Newman" <ewn87544@xxxx> 
wrote:
> 
>  I am trying to write a backtest to BUY at the Support level S1 and 
> sell when the Resistance level R1 is reached. The codes I have been 
> trying will not BUY at the S1 or Sell at R1. How can I get AB to 
only 
> buy at S1 when the price has actually traded in that range. I would 
put 
> in an order to buy that price if touched and sell at R1 if touched. 
I 
> just can't seem to be able to backtest this. 
> 
> 
> PP = Ref(Avg,-1);
> R1=(PP * 2) - Ref(Low,-1);
> S1= (PP * 2) - Ref(High,-1);
> 
> if (S1[0] < Low[0]) 
> Buy = 0;
> else if (S1[0] > Low[0])
> Buy = S1;
> BuyPrice = S1;
> if (R1[0] > High[0])
> Sell = 0;
> else if (R1[0] < High[0])
> Sell = R1;
> SellPrice = R1;
> 
> THANKS Ernie





------------------------ 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
--------------------------------------------------------------------~-> 

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/