Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

" On Bar Close " signal on " On price Change" calculation

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

    " On Bar Close " signal on " On price Change" calculation

    HI,
    my strategy is using "On price change" calculation.
    however I need "on bar close" for some signal/indicators within the strategy . is that possible ?
    I'm using Strategy Builder.
    Thanks

    #2
    Hello Harryh007,

    Thanks for your post.

    Yes, logic can be separated between Calculate.OnPriceChange and Calculate.OnBarClose using IsFirstTickOfBar (Misc folder > IsFirstTickOfBar).

    Please note that a hosted script will inherit the Calculate mode of the script that hosts it. You can take the following approach to differentiate logic between OnBarClose and OnPriceChange processing.

    See this reference sample which demonstrates a technique used for those who need to separate their logic to calculate some values on each tick and others only at the close of a bar. This reference sample uses an unlocked script instead of the Strategy Builder but the same concept applies.

    You will set your host script to Calculate.OnPriceChange and use if(IsFirstTickOfBar) and place all code that needs to calculate once every bar within that condition Set. Then place all code that you want to calculate OnPriceChange in a separate Set outside of the IsFirstTickOfBar condition Set.

    SampleEnterOnceExitEveryTick -https://ninjatrader.com/support/help...either_cal.htm

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,
      Thanks for reply.
      I could not find IsFirstTickOfBar on strategy builder. I could find "First bar of session"

      Comment


        #4
        Hello Harryh007,

        Thanks for your note.

        IsFirstTickOfBar could be found in the Misc folder > IsFirstTickOfBar in the Strategy Builder.

        See the attached screenshot showing where this is located.

        Note to ensure that you are updated to the latest version of NinjaTrader (8.0.26.0). Your current version of NinjaTrader could be found by going to Help > About.

        Let us know if we may further assist.
        Attached Files
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi Brandon,
          there is none on mine. I'm using version 8.0.22.2 64-bit

          Click image for larger version

Name:	Capture.JPG
Views:	21
Size:	27.3 KB
ID:	1201737

          Comment


            #6
            Hello Harryh007,

            Thanks for your note.

            I see that you are currently using an older version of NinjaTrader. IsFirstTickOfBar is not available to use in the Strategy Builder for the version of NinjaTrader you are running.

            You would need to upgrade to the most recent version of NinjaTrader to use IsFirstTickOfBar in the Strategy Builder.

            To update NinjaTrader, please follow the steps below:
            • First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
            • Click on the link: https://ninjatrader.com/PlatformDirect
            • Enter your license key and press Submit
            • Select 'Download'
            • Critical: Before running the installer, ensure NinjaTrader is closed.
            Let us know if we may assist further.


            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              thanks for the guidance

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Market1337, Today, 08:54 AM
              0 responses
              13 views
              0 likes
              Last Post Market1337  
              Started by Bobin, Today, 04:29 AM
              1 response
              13 views
              0 likes
              Last Post bltdavid  
              Started by Lyubomir Kratinov, Today, 06:36 AM
              2 responses
              17 views
              0 likes
              Last Post Lyubomir Kratinov  
              Started by joostb, Today, 12:59 AM
              2 responses
              12 views
              0 likes
              Last Post joostb
              by joostb
               
              Started by Shai Samuel, Today, 02:35 AM
              0 responses
              12 views
              0 likes
              Last Post Shai Samuel  
              Working...
              X