Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple bar painting based on open/close positions

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

    simple bar painting based on open/close positions

    Good evening. New NinjaScript developer here. I'm trying to develop a very simple piece of code:

    1. paint the bar blue if the bar open occurs in the bottom 1/3 of the range and the close occurs in the top third of the range.

    2. paint the bar pink if the reverse (opens top third and clsoes bottom third).

    It should be pretty simple. I'll attach the file to the post.

    What am I leaving out? The compile errors state:
    Indicator\RangeBars.cs Method name expected CS0149

    I'm sure it's just a simple declaration I'm leaving out somewhere. Can anyone offer some assistance? I'd really appreciate it. Thanks in advance.
    Last edited by paschall; 09-15-2009, 09:04 PM.

    #2
    paschall, Welcome to the forums!

    Instead of:
    if (Open[0] >= (Low[0]+ .66(Range)) && Close[0] <= (Low[0]+ .33(Range)))

    Try this:
    if (Open[0] >= (Low[0]+ .66*Range()[0]) && Close[0] <= (Low[0]+ .33*Range()[0]))

    The other line will have to be tweaked just like the one above.
    AustinNinjaTrader Customer Service

    Comment


      #3
      thank, NT_Austin!

      Thanks, NT_Austin, I'll give it a try.

      It seems that my MATLAB got in the way of my NinjaScript. Not at all unlike when I was in Brazil. My "Portunol" (a unique blend of spanish and portuguese spoken only by me, it seems) made it almost impossible to communicate, even though people generally FELT like they knew what I was trying to say. hahaha.

      Thanks agian. I'll try it out as soon as I finish here.

      cheers,
      D

      Comment


        #4
        No problem, paschall. Let us know if you have any more questions.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X