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

Range Bar and Entry Candle

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

    Range Bar and Entry Candle

    Hi!
    i'm using the strategy builder to define a strategy based on range bars,
    i would like to define an entry only after a green candle appeared.
    but: open [1] < close [1] isn't working.

    can someone point me in the right direction pls.?
    thx



    #2
    Hello Tradexxx, thanks for your post.

    I would need to see your strategy for a specific answer, you may Export it and post it here if you wish. I have attached a simple strategy that implements this condition.

    Please let me know if I can assist further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris, thank you very much!

      This one buys also after red bars ....?
      Last edited by Tradexxx; 07-03-2019, 07:42 AM.

      Comment


        #4
        Hi Tradexxx. No this will only enter long if a green bar is detected.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris,

          prob i'm doing something wrong....?
          pls. see attached screen.

          the pictures causes another question:
          how can i ensure that an entry is only happening at the event and not sometimes later when other conditions are fullfilled?
          is there a way to do that?
          thank you!

          Comment


            #6
            Hello Tradexxx, thanks for your reply.

            This is because you are running the strategy OnBarClose, it will only evaluate the OnBarUpdate method on the close of every bar. You have the option to run the strategy OnEachTick or OnPriceChange. This does mean you need to be more careful with your entry and exit as the OnBarUpdate method calculates multiple times intrabar e.g.: https://clauber.tinytake.com/tt/MzYyMDk5MF8xMDk1OTc4Nw

            Best regards.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi Chris,

              thank you for the information.
              Unfortunately i don't understand it.
              Independent from the calculated method, the entries appear at each candle.
              no matter if the candle is red or green...?

              Comment


                #8
                Hi Tradexxx,

                The strategy is entering on those red bars because the bar two behind that one is green. When you put 1 for bars ago in the condition, that means the previous bar, so the entry will happen at the open of the next bar. You can set this to 0 and you will see the strategy enter on only the green bars.

                Kind regards.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by trilliantrader, 04-18-2024, 08:16 AM
                4 responses
                18 views
                0 likes
                Last Post trilliantrader  
                Started by mgco4you, Today, 09:46 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by wzgy0920, Today, 09:53 PM
                0 responses
                9 views
                0 likes
                Last Post wzgy0920  
                Started by Rapine Heihei, Today, 08:19 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Rapine Heihei, Today, 08:25 PM
                0 responses
                10 views
                0 likes
                Last Post Rapine Heihei  
                Working...
                X