• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HeikenAshi Question

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

    HeikenAshi Question

    If I am running a strategy and want to go long when the HeikenAshi is a green candle, why doesn't this open a position.........

    // Condition set 1
    if (Position.MarketPosition == MarketPosition.Flat
    && BarColor == Color.Green)

    {
    EnterLong("");
    }
    Last edited by edgeliner; 05-04-2011, 09:52 AM.

    #2
    Hi EdgeLiner,

    Unfortunately there is no support for accessing the color values of bar series or indicators programatically. The BarColor property is for assignment only - can't read from it. You have to identify the conditions that cause a color change.

    In a standard bar, this is simply Close[0] > Open[0]. HeikenAshi uses a different implementation, but you can check source code for it by clicking Tools > Edit NinjaScript > Indicator > Select HeikenAshi and Open.
    Ryan MNinjaTrader Customer Service

    Comment


      #3
      Yea Ryan.....that's what I figured and is exactly what I did....thanks for the confirmation.......

      Comment


        #4
        Ryan.......

        I have tried various codes to do this to no avail. Any chance you could show me how it would look?

        Comment


          #5
          Ryan......

          Simply put, I am trying to do this........

          if HeikenAshi().HAClose[0] > HeikenAshi().HAOpen[0]
          {
          EnterLong();
          }

          Comment


            #6
            That looks OK. Did you notice any issues using it? Only thing I see is you need parentheses. ( )

            if (HeikenAshi().HAClose[0] > HeikenAshi().HAOpen[0])
            {
            EnterLong();
            }
            Ryan MNinjaTrader Customer Service

            Comment


              #7
              You know what Ryan.....you are right......it does work! Sorry!

              Comment


                #8
                Glad to hear. Thanks for following up!
                Ryan MNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by edgeliner View Post
                  Ryan......

                  Simply put, I am trying to do this........

                  if HeikenAshi().HAClose[0] > HeikenAshi().HAOpen[0]
                  {
                  EnterLong();
                  }
                  Hello everyone,
                  Does this code work for renko ?

                  i use NT8

                  Thanks

                  Comment


                    #10
                    Hello aemaem,

                    The HeikenAshi indicator can be applied to a chart with Renko bars. Calling the indicator in a script would be the same.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by ajsdnyyrr1234DDf, Today, 09:39 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post ajsdnyyrr1234DDf  
                    Started by afoschini, Today, 09:18 AM
                    1 response
                    4 views
                    0 likes
                    Last Post NinjaTrader_Jim  
                    Started by rexsole, Today, 08:02 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_PatrickG  
                    Started by johnnybegoode, Yesterday, 07:06 PM
                    1 response
                    18 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by johnnybegoode, Yesterday, 10:06 PM
                    1 response
                    13 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Working...
                    X