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

Indicator value to current price action

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

    Indicator value to current price action

    Hello,
    Is there a way to assign an indicator a value so when current price interacts with the indicator (crosses above/below), an order will be triggered at the point of interaction? For example: If current price >= SMA, an order will be triggered at the point of contact. In real time, not bar close. Thank you in advance. Every time I try to make this work, the order entry is way off from the point of price/indicator contact.

    Also, is there a way to make an order trigger on every candlestick that does this, but not multiple times per candlestick and only if a current order is not open ? I would only like this to happen once per candlestick, but if price interacts with the indicator again 3 bars down and the road no order is currently open, I'd like it to trigger an order on that bar as well.

    Sorry for the confusion lol. Thanks again!
    Last edited by chrisca; 06-16-2017, 01:32 PM.

    #2
    Hello chrisca,

    Thanks for opening the thread and welcome to our support forums!

    You could create a strategy that has CalculateOnBarClose set to false to get the entry on the first tick in which the condition becomes true.

    The strategy could be made through the Strategy Wizard without having to write the code manually. I have provided a video demonstrating how you can create the condition and action in the Strategy Wizard: https://www.screencast.com/t/btyc1T69e

    I would recommend to view the Strategy Wizard 301 recorded webinar for complete run down on using the Strategy Wizard.

    Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBiNYsf1e8

    CalculateOnBarClose - https://ninjatrader.com/support/help...onbarclose.htm

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thank you for that Jim. That did help. Now, the other problem I am facing though is that the strategy seems to pick and choose which bar to trigger an order on, even if multiple bars meet the same criteria. Can you help me change this so if there is no order currently open, and another bar meets the same criteria (even if the next bar interacts with the indicator), this will trigger an order as well? Sorry if this sounds confusing, but in a standard market session, there can be 10 candles that will meet this criteria with no open orders, but only one or two of those candles will be triggered.

      Comment


        #4
        Hello chrisca,

        Thanks for the additional question.

        You can use "Current market position" to make a condition to enter based on a flat position, and exit based off of a long or short position.

        The Strategy Wizard 301 tutorial touches on this here: https://www.youtube.com/watch?v=FmBi...tu.be&t=26m53s

        The NinjaScript syntax that the Strategy Wizard uses and the usage for these items can be found in the help documentation. Here is a link to Position.MarketPosition: https://ninjatrader.com/support/help...etposition.htm

        Please let me know if I can be of further help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks JIm,

          This would be easier, yet a little more complicated, but is there any way possible to create a pending limit order that is linked to the current value of an indicator? That way, if price touches or crosses the pending order, it will be filled.

          Thanks for help Jim,
          Chris

          Comment


            #6
            Hello Chris,

            You could attach an order to an indicator that can start an ATM strategy. This can be done from the SuperDOM or from a chart with Chart Trader.

            I have provided a link to the ATM 301 recorded webinar where it demonstrates how you can do this in the SuperDOM window: https://youtu.be/DH9y-j64X1U?t=36m57s

            If you have any additional questions, please don't hesitate to ask.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jpapa, Today, 07:22 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            116 responses
            2,757 views
            1 like
            Last Post kevinenergy  
            Started by franatas, 12-04-2023, 03:43 AM
            7 responses
            106 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Jltarrau, Today, 05:57 AM
            3 responses
            8 views
            0 likes
            Last Post Jltarrau  
            Started by f.saeidi, Today, 05:56 AM
            2 responses
            8 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X