Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buying at Channel Breakout price @ current candle @ current price

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

    Buying at Channel Breakout price @ current candle @ current price

    Hi I was curious, what is the easiest way to get the strategy builder to buy at the price its breaking out of the Doncian Channel, at the price its breaking out at, on the current bar its breaking out. I have tried several different ways, and it either buys a random proceeding candle, or it buys the current candle for some random unknown reason.

    To me the condition being set of the ask crossing over the defined period of the channel on the previous bar should achieve this. (I am currently trying to used greater than) But it does not when back tested, or ran on a sim account. I have been playing around with this for over a 2 weeks, so any help at all would be appreciated.

    Thank you!

    #2
    Hello Ryan333,

    Thank you for your post.

    What Calculate setting are you using?

    You could use Calculate.OnEachTick or Calculate.OnPriceChange to be able to enter intrabar.

    Calculate.OnBarClose means the script will call OnBarUpdate only at the close of each bar.



    If you have further questions please let us know.

    Comment


      #3
      I have the calculate settings at each tick so I don't think that is the issue. I have included a fill and the condition being used. It filled at 11:05pm @ 2110.70. This was no where near the actual channel line, the channel wasn't breeched, but it continues to keep buying.

      Ideally I would be making the purchase when a candle is breeching the channel, making a new high at the time.

      Sorry if all the pictures are too much info, I feel like this problem is really easy to fix and I'm just over looking something.

      Comment


        #4
        Hello,

        Thank you for your response.

        To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

        Below is a link to a forum post that demonstrates using prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.


        Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

        Let me know if you need any assistance creating a print or enabling TraceOrders.

        Save the output from the output window to a text file and provide this with your reply.

        I'll be happy to assist with analyzing the output.​

        Comment


          #5
          If there are any extra resources I can use when trying to get it set up I would appreciate it. I thought I had the builder kind of figured out, but its looking like I do not. I have 0 programming knowledge outside of a little HTML back in like 2005, and calling it knowledge is being liberal .

          Thank you for all your help so far! I am sure I will have many more questions from this point on.

          Is there a video library that really breaks everything down step by step like I'm 5? Even concepts like order handling logic are throwing me for a loop at times.

          Thanks again!

          Comment


            #6
            Helo Ryan333,

            This support article contains educational resources for getting started with NinjaScript:

            https://support.ninjatrader.com/s/article/Developer-Guide-Getting-Started-with-NinjaScript

            Below is YouTube video that goes over the Strategy Builder:



            This page goes over the internal order handling rules:



            Please let us know if we can assist further.

            Comment


              #7
              Thank you!!!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              48 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              126 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              66 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              42 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X