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

Builder Conditions Alert

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

    Builder Conditions Alert

    I would like to write an alert in NT7:

    Conditions:
    - range: 8:00 - 9:00 AM
    - if breaks ONLY above range send alert

    How to set this in strategy builder?

    Thanks

    #2
    Hello truskawa,

    Welcome to the NinjaTrader support forums.

    For time ranges you can create that by using the following steps in the condition builder. This requires two conditions to create a window of time.

    First condition:
    Left: Time -> Time Series
    Center: >=
    Right: Time -> Time Value -> enter start time.

    First condition:
    Left: Time -> Time Series
    Center: <=
    Right: Time -> Time Value -> enter end time.

    For each set where you want a time filter this type of logic can be added.

    By breaks above range, do you mean if the close price is above some predefined range? Can you detail this part further please?


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      By breaks above range, do you mean if the close price is above some predefined range?

      First:
      Close price is above predefined range

      Second:
      High price is above predefined range with min 2 ticks

      Comment


        #4
        Hello truskawa,

        Thank you for the clarification.

        To check if the Close is above a predefined price you can use:

        Left: Price Data -> Close
        Center: >
        Right: Pick a selection of Price Data or Indicator or a user Input.

        Depending on what value you want to check would determine what you need to do for the right side of the condition. If you want to type in a value you would need to create a User Input from the first screen the builder brings you to, the user input screen. In your code you would then select on the right side User Defined Inputs -> your input name.

        For further information on creating conditions in the builder I would suggest watching the strategy builder webinar: https://youtu.be/FmBiNYsf1e8


        The High would be slightly different because you want the Offset applied. You could check that the High plus two ticks is greater than your input:


        Left: Price Data -> High -> Enter 2 for the Offset and leave Ticks selected
        Center: >
        Right: Select the user Input.



        I look forward to being of further assistance.


        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse

          I don't know how to insert predefined range data 8:00-9:00 AM to input (right side)

          Comment


            #6
            Hello truskawa,

            In NT7 there is not a way to utilize a User Input with the time condition directly, to use the input would require unlocking the strategy and manually making that modification. This is an item which has been updated going forward in NT8 and is available in the NT8 strategy builder.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              So could you do this conditions to NT8?

              Comment


                #8
                Hello truskawa,

                Correct, the newer iteration of the strategy builder includes quite a few new features one of them being time inputs. Similar to the Int or Bool inputs there is a Time inputs in NT8's builder, that allows comparison with the Time series.

                What I generally suggest for NT7 is to make your strategy with static values or just embedded times like you have. When you are satisfied it is working and want to start testing different ranges of time, duplicate it and unlock it. At that point I could assist with details on how to make a time input if needed, you can also search for "Time" in the public user app share for a lot of indicators which utilize time to get examples of how time can be used. https://ninjatraderecosystem.com/user-app-share/

                There are a couple different ways to select time, you can use int's or timespans depending on the type of input you wanted. An int is very simple and can be used with ToTime in comparisons:


                Other samples you may find online could include using a TimeSpan object and other attributes on a property to make a input time. This is more complex and if you had questions on this we could likely track down a sample on the app share.



                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by pechtri, 06-22-2023, 02:31 AM
                10 responses
                124 views
                0 likes
                Last Post Leeroy_Jenkins  
                Started by judysamnt7, 03-13-2023, 09:11 AM
                4 responses
                59 views
                0 likes
                Last Post DynamicTest  
                Started by ScottWalsh, Yesterday, 06:52 PM
                4 responses
                36 views
                0 likes
                Last Post ScottWalsh  
                Started by olisav57, Yesterday, 07:39 PM
                0 responses
                7 views
                0 likes
                Last Post olisav57  
                Started by trilliantrader, Yesterday, 03:01 PM
                2 responses
                22 views
                0 likes
                Last Post helpwanted  
                Working...
                X