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

[amibroker] Problem with Exploration



PureBytes Links

Trading Reference Links





Many thanks to all for assisting me with my first 
Exploration.  It worked fine, until I added the final five columns that are 
supposed to report the dates that the trades occurred on, as well 
as the number of days that each position was held.  I also added a column 
GAINSTODATE which is supposed to  report the total of gains to date, so 
this column is also questionable.  When I click on explore, I get an 
error message that there are too many arguments.  This error occurs at the 
DAYS IN TRADE= line of code.   BTW, this is not my trading plan,I am 
just using the idea of oversold and overbought stochs crossing to debug this 
exploration before I use it for real. All help will be appreciated. Ron 
D
 
FastStoch = StochK( 
14 );
SlowStoch = StochD( 
14 );
Buy = Cross( 
FastStoch, SlowStoch );
Sell = Cross( 
SlowStoch, FastStoch );

StochKBuy = ValueWhen( 
Buy, FastStoch );
StochKSell = ValueWhen( 
Sell, FastStoch );
StochKDiff = StochKSell - StochKBuy;
EPrice = ValueWhen( 
Ref( 
Buy,-<FONT color=#ff00ff 
size=1>1), Open );
XPrice = ValueWhen( 
Ref( 
Sell,-<FONT color=#ff00ff 
size=1>1), Open );<FONT face="Courier New" 
size=1>
GainPerTrade = XPrice - EPrice;
PctRtn = GainPerTrade <FONT 
size=1>/ EPrice * 100<FONT 
size=1>;
GainsToDate =<FONT face="Courier New" color=#0000ff 
size=1>Sum(GainPerTrade,<FONT 
face="Courier New" color=#0000ff size=1>BarsSince<FONT face="Courier New" 
size=1>(Buy)); <FONT face="Courier New" 
size=1>
DaysInTrade=<FONT face="Courier New" color=#0000ff 
size=1>DateTime(Sell)-<FONT 
face="Courier New" color=#0000ff size=1>DateTime<FONT face="Courier New" 
size=1>(Buy);
Filter = C > 1<FONT 
size=1> AND C < <FONT color=#ff00ff 
size=1>100 AND V > <FONT 
color=#ff00ff size=1>100000 AND 
Buy OR Sell;<FONT 
color=#0000ff size=1>
SetOption(<FONT color=#ff00ff 
size=1>"NoDefaultColumns", True );<FONT 
color=#0000ff size=1>
AddColumn( StochKBuy, <FONT color=#ff00ff 
size=1>"Buy Value", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( StochKSell, <FONT color=#ff00ff 
size=1>"Sell Value", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( StochKDiff, <FONT color=#ff00ff 
size=1>"%K Diff", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( EPrice, <FONT color=#ff00ff 
size=1>"Entry $", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( XPrice, <FONT color=#ff00ff 
size=1>"Exit $", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( GainPerTrade, <FONT color=#ff00ff 
size=1>"$ Rtn", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( PctRtn, "% 
Rtn", 1.2<FONT 
size=1> );
AddColumn( <FONT face="Courier New" 
size=1>GainsToDate,<FONT color=#ff00ff 
size=1>"$Total<FONT 
color=#ff00ff size=1>", <FONT color=#ff00ff 
size=1>1.2 );
AddColumn( <FONT color=#0000ff 
size=1>IIf( Buy, <FONT color=#ff00ff 
size=1>66, 83<FONT 
size=1> ), "Signal", 
formatChar );
AddColumn( <FONT color=#0000ff 
size=1>DateTime(Buy), <FONT color=#ff00ff 
size=1>"Eday", formatDateTime );<FONT 
color=#0000ff size=1>
AddColumn( <FONT color=#0000ff 
size=1>DateTime(<FONT face="Courier New" 
size=1>Sell), <FONT color=#ff00ff 
size=1>"X<FONT 
color=#ff00ff size=1>day", formatDateTime 
);
AddColumn( DaysInTrade<FONT face="Courier New" 
size=1>,"<FONT face="Courier New" 
color=#ff00ff size=1>DaysHeld"<FONT 
size=1>, formatDateTime );
 
 






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.