PureBytes Links
Trading Reference Links
|
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@xxxxxxxxx>
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.3001176/D=g
roups/S=1705632198:HM/EXP=1099924822/A=2376776/R=0/SIG=11ldm1jvc/*http://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/
|