Hello,

x = ... condition for signal 1 
y = .... condition for signal 2 

dn = DateNum();

barx1 = ValueWhen( x, dn );
barx2 = ValueWhen( y, dn );

x_y_are_on_same_bar = ( barx1 == barx2 ); // note the result will also be array 
(vector)

The other approach (if you operate in loop and processing bar by bar
and when you know the bar number (scalar)) you can use the following

dn = DateNum();

bar1 = ... some calculation that gives you scalar bar number
bar2 = ... some calculation that gives you scalar bar number


if( dn[ bar1 ] == dn[ bar2 )
{ 
 // the DAY is the same for both bars
}

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: Łukasz Bigos 
  To: [email protected] 
  Sent: Monday, August 17, 2009 4:40 PM
  Subject: Re: [amibroker] Changing interval and using FOR loop




  Ok. Thank you Tomek for help. I'll better read something more about AFL.

  Maybe you can tell me one more thing:
  I have two 5m bars : How can I compare them ( i mean bool information if it 
is the same day or not) .

  Thanks for help

  Regards 
  raskoks




  On Mon, Aug 17, 2009 at 4:31 PM, Tomasz Janeczko <[email protected]> wrote:

       

    Must read:
    http://www.amibroker.com/guide/h_understandafl.html

    This is absolutely must read for everyone, and especially for people who 
think 
    "I know C++ and the syntax looks the same for me".

    AFL is array (vector processing) language, it is much higher level than C++ 
and you need 
    to learn to think with vectors in mind.

    Your question is way too general to give you answer. You need to specify 
exactly what
    you want.

    There are lots of samples here:
    http://www.amibroker.com/kb/

    and here:
    http://www.amibroker.org/userkb/


    Best regards,
    Tomasz Janeczko
    amibroker.com
      ----- Original Message ----- 
      From: Łukasz Bigos 
      To: [email protected] 
      Sent: Monday, August 17, 2009 3:53 PM
      Subject: Re: [amibroker] Changing interval and using FOR loop



      Ok, I used loops and it worked ok ( habbits from C++)
      But  I'm sure that you are right ;) 

      In this case, how can I control my system ? I mean, for example i want 
use different signals depends on current position (long,short or size of 
position)?
      Maybe someone can give me some example.
      I will be grateful.

      Best regards
      raskoks


      On Mon, Aug 17, 2009 at 3:42 PM, Tomasz Janeczko <[email protected]> 
wrote:

          
        Advice for the novice: *DO NOT* use loops! 
        They are only needed in very few cases
        and NEVER if you are beginner.

        Correct formula would be WITHOUT any for loop and WITHOUT
        subscripts.

        CoverPrice = TimeFrameExpand( Wsk,inDaily);

        Best regards,
        Tomasz Janeczko
        amibroker.com


        ----- Original Message ----- 
        From: "raskoks" <[email protected]>
        To: <[email protected]>
        Sent: Monday, August 17, 2009 11:35 AM
        Subject: [amibroker] Changing interval and using FOR loop

        >I wonder if it is a good idea to use FOR loop in my systems. I mean 
smth like:
        > for (i=0,i<BarCount();i++) {}
        > What do you think ? Because I've got big problems when i working on 
tables and try to control steps of my system.
        > 
        > Maybe someone can help me with this problem:
        > I try to use smt like that:
        > 
        > for (i=0,i<BarCount();i++) 
        > {CoverPrice[i]=(TimeFrameExpand(Wsk[i],inDaily)
        > }
        > 
        > And i've got a mistake - someone know how to do smth like that ?
        > 
        > Regards
        > raskoks
        > 
        > 
        > 

        > ------------------------------------ 

        > 
        > **** IMPORTANT PLEASE READ ****
        > This group is for the discussion between users only.
        > This is *NOT* technical support channel.
        > 
        > TO GET TECHNICAL SUPPORT send an e-mail directly to 
        > SUPPORT {at} amibroker.com
        > 
        > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
        > http://www.amibroker.com/feedback/
        > (submissions sent via other channels won't be considered)
        > 
        > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
        > http://www.amibroker.com/devlog/
        > 

        > Yahoo! Groups Links
        > 
        > 
        > 





      -- 
      Nawet woda czasem śpi ...




  -- 
  Nawet woda czasem śpi ...



  

Reply via email to