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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        264 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        169 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        171 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        258 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        210 views
        0 likes
        Last Post CarlTrading  
        Working...
        X