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

[amibroker] Re: SNiper



PureBytes Links

Trading Reference Links


HI Terry,
Thanks for advise.
 Mom stands for momentum .I had only pasted the part of code to 
avoid confusion.I have included your suggestions.But the part iam 
not getting is whether 5 day strength , I coded is  adequate to  the 
concept.Coz I also did the same analysis in excel sheet , so for the 
same scrip instead of values to match they dont!Pls comment.

Regards
Pls find the whole code

R1=(MA(H,3)-MA(Ref(L,-1),3))+L;
R2=((MA(Ref(H,-1),3))-MA(H,3))+H;
R3=H;
R4=2*Avg-L;
Sellno=(R1+R2+R3+R4)/4;
S1=H-(MA(Ref(H,-1),3)-MA(L,3));
S2=L-(MA(Ref(L,-1),3)-MA(L,3));
s3=L;
S4=2*Avg-H;
Buyno=(S1+S2+S3+S4)/4;
//1-Day strength
DS1=(C-L)/(H-L)*100;
//5-Day Strength
DS5=(C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100;
//LSS-5Day Oscillator
X=HHV(H,5)-Ref(O,-5);
Y=C-LLV(L,5);
LSSO=(X+Y)/((HHV(H,5)-LLV(L,5))*2);
AvgLSSO=MA(LSSO,3)*100;
//Momentum
Mom=AvgLSSO-Ref(AvgLSSO,-3);
//Add these lines for next day OPEN trading
SetTradeDelays(1,1,1,1);
BuyPrice = SellPrice = ShortPrice = CoverPrice = Open;
condbuy1 = 65<DS5>95 AND LSSo>50 AND mom>-10 AND DayOfWeek() == 5;
condbuy2 = DS5>83 AND LSSo>50 AND mom>-40 AND DayOfWeek() == 4;
condsell = DS5>53 AND LSSo >70 AND mom> -10 AND DayOfWeek() == 2;
Buy = condbuy1 OR condbuy2;
Sell=Condsell;


//Note conditions are tested the day before so you get, for example
//Friday's conditions for a Monday buy

Filter=Buyno AND  Sellno;
AddColumn(Buyno,"BuyNo");
AddColumn(Sellno,"SellNo");
AddColumn(DS1,"1-Day Strength");
AddColumn(DS5,"5-Day Strength");
AddColumn(AvgLSSO,"AVg LSS 5-Day OSC ");
AddColumn(Mom,"Momentum ");
Plot(DS5,"5 Day strength",colorGreen,1);
Plot(Mom,"Momentum",colorRed,2);
Plot(AvgLSSO,"Smooth LSS Oscillator",colorBlue,4);
Plot(LSSO," LSS Oscillator",colorBlue,4);

--- In amibroker@xxxxxxxxxxxxxxx, Terry <MagicTH@xxxx> wrote:
> Some questions and suggestions:
> 
> mom is not defined below. What is it?
> 
> Your buys with DayOfWeek do not make sense.
> Try changing your conditions as follows:
> 
> //Add these lines for next day OPEN trading
> SetTradeDelays(1,1,1,1);
> BuyPrice = SellPrice = ShortPrice = CoverPrice = Open
> 
> condbuy1 = 65<LSS>95 AND LSSosc>50 AND mom>-10 AND DayOfWeek() == 
5;
> condbuy2 = LSS>83 AND LSSosc>50 AND mom>-40 AND DayOfWeek() == 4;
> condsell = LSS>53 AND LSSosc >70 AND mom> -10 AND DayOfWeek() == 2;
> Buy = condbuy1 OR condbuy2;
> Sell = condsell;
> 
> //Note conditions are tested the day before so you get, for example
> //Friday's conditions for a Monday buy
> -- 
> Terry
> 
> 
> From: "iascool" <sai20_2000@xxxx>
> Reply-To: amibroker@xxxxxxxxxxxxxxx
> Date: Sun, 07 Nov 2004 14:39:54 -0000
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] SNiper
> 
> 
> Hello,
> I have tried to code some concepts from Sniper Trading , but have
> not achieved results to one i have in excel sheet.Where am I going
> wronge in code?Any Suggestions.
> 
> 1)5Day strength index-
> (Close-Lowest price in last 5days)/(highest price in last 5 days-
> Lowest price in last 5 days) * 100
> 
> code-//5-Day Strength
> DS5=(C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100;
> 
> 2)lss oscillator
> X=highest price in last 5 days-open 5days ago
> Y=last close - lowest price in last 5 days
> lssosc = (X+Y)/((highest price in last 5 days - Lowest Price in 
last
> 5 days)*2)*100
> 
> Code//LSS-5Day Oscillator
> X=HHV(H,5)-Ref(O,-5);
> Y=C-LLV(L,5);
> LSSO=(X+Y)/((HHV(H,5)-LLV(L,5))*2)*100;
> 
> 3)Buy on Monday if(on friday close)
> 65<LSS>95 and LSSosc>50 and mom>-10
> Buy on Friday if( on thrusday close)
> LSS>83 and LSSosc>50 and mom>-40
> Sell on Wednesday if( on tuesday close)
> LSS>53 and LSSosc >70 and mom> -10
> 
> Code
> condbuy1= 65<LSS>95 AND LSSosc>50 AND mom>-10;
> condbuy2= LSS>83 AND LSSosc>50 AND mom>-40;
> condsell= LSS>53 AND LSSosc >70 AND mom> -10;
> buy= iif( condbuy1,Dayofweek()==1,condbuy2);
> Sell=iif(condsell,dayofweek()==6, 1);
> 
> Kind Regards
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
> Yahoo! Groups Sponsor
>  
>  ADVERTISEMENT
>  
<http://us.ard.yahoo.com/SIG=12984tvj0/M=294855.5468653.6549235.30011
76/D=g
> 
roups/S=1705632198:HM/EXP=1099924822/A=2376776/R=0/SIG=11ldm1jvc/*htt
p://pro
> motions.yahoo.com/ydomains2004/index.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
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
> *  
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service
> <http://docs.yahoo.com/info/terms/> .





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/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/