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

[amibroker] Exploration Problem



PureBytes Links

Trading Reference Links




 

Steve, thanks for your response.  This email 
will explain in detail what I hope to accomplish.  This exploration assumes 
that you have a day job, and are making buy and sell decisions each 
night with a fresh download of   EOD data. Therefore, a 
buy signal and the subsequent sell signal will never happen on 
the same day. 
 
I want to be able to read a detailed report of the 
results of (buying on the open) of the next day following an occurrance of 
 my buy condition. My buy condition is 
Cross(stochkd(14),stochd(14)).   My sell condition will 
occur when the next    
cross(stochd(14),stochk(14))  makes it's appearance in one 
of the daily downloads of  EOD data. The actual sell will 
occur at the opening price of the day 
after the sell condition appeared.  eg, (selling on the open).
 
Below is the complete exploration.  The seven "plot(xxxxxx" lines of 
code at the bottom of this exploration are my attempt to set up the column 
titles for displaying the data that I want to be able 
to analyze.   
 
I could actually feel some of the gears in my brain grinding as I tried to 
understand the proper way to  use ValueWhen and BarsSince.   
I hope we can  get this working. Ron D
 
<FONT face=Arial 
size=2>==========================================================================
BuyStocVal=<FONT color=#0000ff 
size=1>ValueWhen(<FONT color=#0000ff 
size=1>Cross(<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochD(<FONT color=#ff00ff 
size=1>14)),<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14),1<FONT 
size=1>);//<FONT 
color=#008000 size=1>This is the value of StochK(14) when the buycross 
occurred.

SellStocVal=ValueWhen<FONT 
size=1>(Cross(<FONT 
color=#0000ff size=1>StochD(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14)),<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>BarsSince(<FONT color=#0000ff 
size=1>Cross(<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochD(<FONT color=#ff00ff 
size=1>14)));<FONT face="Courier New" color=#008000 
size=1>//StochK(14) value at 
sellcross.
StocRise=SellStocVal-BuystocVal; < the difference in the <FONT 
color=#0000ff size=1>StochK(<FONT color=#ff00ff 
size=1>14)<FONT face="Courier New" color=#008000 
size=1>// Buy AND Sell values, assumed to be a 
positive value.
Entryprice=ValueWhen<FONT 
size=1>(Cross(<FONT 
color=#0000ff size=1>StochK(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochD(<FONT color=#ff00ff 
size=1>14)),<FONT color=#0000ff 
size=1>Ref(Open,<FONT color=#ff00ff 
size=1>0),1<FONT 
size=1>);//<FONT 
color=#008000 size=1>opening price on the Day the Buy occurrs.<FONT 
size=1>
Exitprice=ValueWhen<FONT 
size=1>(Cross(<FONT 
color=#0000ff size=1>StochD(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14)),<FONT color=#0000ff 
size=1>Ref(Open,<FONT color=#ff00ff 
size=1>0),<FONT color=#0000ff 
size=1>BarsSince(<FONT color=#0000ff 
size=1>Cross(<FONT color=#0000ff 
size=1>StochK(<FONT color=#ff00ff 
size=1>14),<FONT color=#0000ff 
size=1>StochD(<FONT color=#ff00ff 
size=1>14)));<FONT face="Courier New" color=#008000 
size=1>//Open price of Sell 
Day.
Pricerise=Exitprice-entryprice<FONT face="Courier New" 
size=1>;//<FONT 
color=#008000 size=1>The difference between the two opening 
prices.
percentrise=pricerise/entryprice;<FONT face="Courier New" 
color=#008000 size=1>//The % of increase on 
the value of the Open price when the Buy occurred.
Filter=C><FONT 
face="Courier New" color=#ff00ff size=1>1 
AND C<<FONT face="Courier New" color=#ff00ff 
size=1>100 AND 
V><FONT face="Courier New" color=#ff00ff 
size=1>100000 AND Buystocval 
AND Sellstocval AND stocrise AND entryprice AND 
exitprice AND pricerise AND percentrise;<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(BuyStocVal,<FONT 
face="Courier New" color=#ff00ff size=1>"Buy Value"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(SellStocVal,<FONT 
face="Courier New" color=#ff00ff size=1>"Sell Value"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(StocRise,<FONT 
face="Courier New" color=#ff00ff size=1>"Stoc Rise"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(Entrypric,<FONT 
face="Courier New" color=#ff00ff size=1>"Buy price"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(Exitprice,<FONT 
face="Courier New" color=#ff00ff size=1>"Sell price"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(Pricerise,<FONT 
face="Courier New" color=#ff00ff size=1>"Price rise"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);<FONT 
face="Courier New" color=#0000ff size=1>
AddColumn(percentrise,<FONT 
face="Courier New" color=#ff00ff size=1>"% change"<FONT 
face="Courier New" size=1>,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>,textcolor=colorDefault,bkgndcolor=colorDefault);
 






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.