Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

pattern code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    pattern code

    Hi,

    I hope someone can give me a hint, cause I'm overlooking something:

    My bool function:
    ---------------------------------------------
    public bool GreenBar1Tick(int barsago)
    {
    if (Close[barsago]>Open[barsago] && Open[barsago] + 1 * TickSize == Close[barsago])
    {
    return true;
    } else return false;
    }
    ---------------------------------------------

    Above function works perfect and shows a diamond above every green candle with 1tick body, see below:
    ---------------------------------------------
    protected override void OnBarUpdate()
    {
    if ( GreenBar1Tick(0) )
    {
    DrawDiamond(CurrentBar.ToString() + "diamond", true, 0, High[0] + TickSize, Color.Red);
    }
    }
    ---------------------------------------------


    When I change the Zero in One like this it stops working......
    ---------------------------------------------
    protected override void OnBarUpdate()
    {
    if ( GreenBar1Tick(1) )
    {
    DrawDiamond(CurrentBar.ToString() + "diamond", true, 0, High[0] + TickSize, Color.Red);
    }
    }
    ---------------------------------------------

    Can someone tell me why? Any suggestions? Thx in advance !


    (cause my goal was to create an easy way to add new patterns instead of typing it all over again and again. For example: if (RedBar3Tick(2) && GreenBar2Tick(1) && RedBar3Tick(0) ) { ......arrow...... }
    Last edited by Creamers; 06-17-2009, 12:51 PM. Reason: html bold didn't work out

    #2
    forget it

    My beginners fault!!!


    if (CurrentBar < 500) // need 3 bars to calculate Low/High
    return;


    Thanks anyway....

    Greetings,
    Bart

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ScottWalsh, Today, 04:29 PM
    0 responses
    4 views
    0 likes
    Last Post ScottWalsh  
    Started by rtwave, 04-12-2024, 09:30 AM
    2 responses
    21 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by tsantospinto, 04-12-2024, 07:04 PM
    5 responses
    69 views
    0 likes
    Last Post tsantospinto  
    Started by cre8able, Today, 03:20 PM
    0 responses
    7 views
    0 likes
    Last Post cre8able  
    Started by Fran888, 02-16-2024, 10:48 AM
    3 responses
    49 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Working...
    X