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

RE: [amibroker] Help please - plotting arrows?



PureBytes Links

Trading Reference Links

Thanks, I'll try your suggestions ;-)

gty


*** Dimitris Tsokakis ***
gty,
When the red spikes appear, EVENT2 occurs after [the most recent]
EVENT1.
EVENT1=Cross(RSI(),50);
EVENT2=2*Cross(RSI(),55);
Plot(EVENT1,"1",colorBlack,2);
Plot(EVENT2,"2",colorWhite,2);
VAL=BarsSince(EVENT1)>BarsSince(EVENT2);
Plot(VAL AND Ref(VAL,-1)==0,"VAL",colorRed,1);


*** Ara Kaloustian ***
Process each independently, then determine which occured first

Cond1 = ...
Cond2 = ...

Cond1_Bar = valuewhen(Cond1,BarIndex(),1);
Cond2_Bar = valuewhen(Cond2,BarIndex(),1);

Compare Cond1_Bar and Cond2_Bar . Smaller value comes first



*** Dave Merrill ***
Have you looked at BarsSince()? Something like this maybe:

  MyCondition = BarsSince(Condition1) < BarsSince(Condition2);

You might need some way to "reset" things again, unless you only care which
one happened most recently.






--- In amibroker@xxxxxxxxxxxxxxx, "gty182" <gty182@xxxx> wrote:
> Hello,
>
> I 've tried everything method I know (maybe I just don't know
much ;-) ) and still don't know how to code this:
>
> I got 2 events , one after other. I want to know wheather (Cross
(Oo,L)  occurs after Cross(H,DSu) ( Oo and DSu are some levels
defined before ) and they both take place same day. So I've  made
something like this:
>
> CondS=( Cross(H,DSu)*TimeNum() < (Cross(Oo,L)*TimeNum() ) AND (
Cross(H,DSu)*DateNum() == Cross(Oo,L)*DateNum() ) ;
>
> But it won't work of course (it checks just one bar, right ? ) I
think i'd have to use some kind of array to "scan" whole day and
check there weather second even takes place after the other one (it
doesn't matter if second one occurs before first one, it's just
importenad if it happens AFTER it) But I'm not really sure how to do
it and where to start.
>
> Maybe there is some simple solution I can't see or something ?
>
> thanks,
>
> gty





------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/