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

EMA crossover "too slow" to long/short on breakout.

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

    EMA crossover "too slow" to long/short on breakout.

    Hello everyone,

    Very new to NT. I'm trying to test this basic strategy of going long/short when the EMA(8) crosses EMA(55). The code works, but i'm having a bit of trouble to get it to do what i want.

    I would like to get it to do one of these 2 things:
    Buy instantly (not on bar close) as the candle/price crosses above the EMA(55)
    OR
    Buy instantly (not on bar close) as EMA(8) crosses above the EMA(55)

    I'm having a bit of trouble understanding how to do that or if it is even possible?

    Any help is appretiated
    Attached Files

    #2
    Hello mohdhm,

    Thanks for your post.

    In the strategy analyzer your strategy code is executed at the end of the bar and any orders are placed on the next bar.

    You are running with 15 minute bars, you might try using 5 minute bars.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello mohdhm,

      Thanks for your post.

      In the strategy analyzer your strategy code is executed at the end of the bar and any orders are placed on the next bar.

      You are running with 15 minute bars, you might try using 5 minute bars.
      Hi Paul,

      The strategy needs to be on the 15 minute chart. Can this not be done using ticks or pricechange? Would ticks even work with cryptocurrencies?

      Comment


        #4
        Originally posted by mohdhm View Post
        Hi Paul,

        The strategy needs to be on the 15 minute chart. Can this not be done using ticks or pricechange? Would ticks even work with cryptocurrencies?
        You will need to enable Tick Replay or else use a secondary time frame for the executions.

        ref: https://ninjatrader.com/support/help...ick_replay.htm

        You can also use High Fill Resolution in the Strategy Analyzer.

        ref: https://ninjatrader.com/support/help...ical_fill_.htm
        Last edited by koganam; 06-25-2018, 04:13 PM.

        Comment


          #5
          Hello mohdhm,

          Thanks for your reply.

          As member koganam has advised you might utilize Tick Replay, however, if your data provider does not support historical tick data you may not be able to use this option. You could utilize a secondary time frame however if you choose to do this then you would not be able to use the High fill option as specified by Koganam (but since you are adding a data series already you can add one that would meet your needs for order fill).

          Here is a link to a working example of this: https://ninjatrader.com/support/help...ipt_strate.htm
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Waxavi, Today, 02:10 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          5 responses
          23 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X