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

RE: [amibroker] Re: Why doesn't this work



PureBytes Links

Trading Reference Links




<SPAN 
class=432322916-28112003>you've got the order of your parameters mixed up I 
think. from the help:
<SPAN 
class=432322916-28112003>    <FONT face="Times New Roman" 
color=#000000 size=3>applystop( type, mode, amount, exitatstop, volatile = 
False ) 
<SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003>also, besides the error 
you're seeing, I don't think you're using BuyPrice correctly. the BuyPrice array 
contains the price at which a buy on that day would be made. to find the price 
at which the last buy was made, which I think is what you want if you're 
reacting to profit so far on the current trade, use 
ValueWhen.
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003>try this exploration on 
a single stock with some set of buy signals to see what I 
mean:
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003>filter = 
1;AddColumn(buy, "buy", 1.0);AddColumn(BarsSince(buy), "BarsSince(buy)", 
1.0);AddColumn(BuyPrice, "BuyPrice");AddColumn(ValueWhen(buy, BuyPrice), 
"cost buying today");AddColumn(ValueWhen(buy, Ref(BuyPrice, 1)), "cost 
buying tomorrow");
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003>note that which day's 
price you want depends on your trade delay for that type of trade. the "cost 
buying today" column is relevant with no delay, "cost buying tomorrow" with one 
day's delay, etc.
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003>HTH,
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003>dave
<SPAN 
class=432322916-28112003><SPAN 
class=432322916-28112003> 
<BLOCKQUOTE 
>OK, 
  fix made but now I get the following error:Line 8, Column 
  34:PositionSize=100000;Var1=IIf(Close>=(BuyPrice+0.003),2,1);Var2=IIf(Close<(BuyPrice+0.003),0.005,0.002);ApplyStop(Var1,2,Var2,True,False);---------------------------------^Error 
  2.Bad argumentsI didn't think my arguments were that bad. 
  (?)James






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.