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

RE: [amibroker] TJ: plotting the same indicator in different charting windows



PureBytes Links

Trading Reference Links


Here was your original email
@@@@@@@@@@@@@@@@@@@@@@
Condition1 = Open -0.48; 
Buy = my formula;
BuyPrice = Condition1;
Buy=IIf((L < Condition1),Buy,0);
Condition2 = BuyPrice + 0.48 ;
sell = my formula; 
sellprice = buyprice +0.50; 

but when in the backtest I examine trades I see that in black candle 
days(i.d. O 16.39 H 16.39 L 15.9 C 15.94)i'm buying at 15.91,and this 
is ok,and i'm selling at 16.39 and that's not correct cause from open 
the stock was going down.So I added Sell=IIf(C > O,Sell,0);but it 
doesn't work.
@@@@@@@@@@@@@@@@@@@@@@

this could satisfy your queries as written, hopefully

Condition1 = Open -0.48; 
Buy = my formula and (L < Condition1) and C>=O;
BuyPrice = valuewhen(buy,O-0.48);

Condition2 = BuyPrice + 0.48 ;
sell = my formula and C>=O; 
sellprice = buyprice +0.50; 


Remember that AB checks on the day of buying and selling that the price
range for that day satisfies your buy/sell price conditions, and if not it
selects the closer of High or Low price for that day. 
Also what delays have you set for the buy/sell, this can make a difference
to the prices reported as it will trade on the delay bar, not the signal
bar. Also you cannot have correct signals if you are using close, open etc
for the actual trade day as theoretically this bar has not occurred. 
A mechanical system must have hard and fast rules, so if you do not want
something to happen it must be coded. Occasionally  this can be difficult
when you have some discretionary conditions, by this I mean you make a
subjective decision. 




Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: chassis_73 [mailto:tessaglia@xxxxxxxxxxx] 
Sent: Wednesday, May 19, 2004 8:53 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Distorted buy

Hi Graham,that's not enough.In short I'd like to say :"If it's a 
black day,where C < O, don't buy.That's my problem.
I can also write : 
oper = C < O;
sell = NOT oper AND ....
By the way how can i say don't buy and don't sell but hold the stock?

Thanks very much
Nick


--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> Try this
> BuyPrice = valuewhen(buy,Condition1);
> 
> 
> Cheers,
> Graham
> 






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 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 
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/