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

Trading Morning Reverseals

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

    Trading Morning Reverseals

    Hello Ninjatrader,

    i want to develop a strategy which trades morning revearsals.

    But my strategy anazlyser get no result.


    I would like to express the following with the strategy: - if the first candlestick of the current day opens between 3 and 10% higher, a limit should be set slightly higher (0.5%) than the previous day.


    GapUpPriorDayHighRangeLow = 1.03;
    GapUpPriorDayHighRangeHigh = 1.1;


    // Set 1
    if ((Bars.IsFirstBarOfSession == true)
    && ((Open[0] * GapUpPriorDayHighRangeLow) >= Close[1])
    && ((Open[0] * GapUpPriorDayHighRangeHigh) <= Close[1]))
    {
    EnterLongLimit(Convert.ToInt32(TradeSize), (PriorDayOHLC1.PriorHigh[0] * LimitüberPriorHigh) , "");
    }

    Hope you can help me.

    Regards
    Robin

    #2
    Hello Lopat,

    Thank you for your post.

    If you're not seeing the strategy take trades, the first thing I would recommend would be to turn on the Order Trace function:

    Strategy Builder > Default Properties > More Properties > Trace Orders, or:

    if (State == State.SetDefaults)
    {
    TraceOrders = true;
    }

    Once you then recompile the strategy, you can open a new NinjaScript Output window under New > NinjaScript Output. This will print a log of any orders submitted by the strategy during while it's running, along with any ignored orders. You can then look through and see what may be occurring.

    Here is a link to our help guide that goes into more detail on tracing orders:

    https://ninjatrader.com/support/help...aceorders2.htm

    Trace orders alone may not give you the full picture of whether or not a trade should have been entered on a given bar, so adding prints to your strategy that will show in the NinjaScript Output window, with information on what the variables you're using for your conditions are on a particular bar, can be helpful.

    This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.

    https://ninjatrader.com/support/foru...ns-not-working

    If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. With the printout information you can assess what is different between the two, and assess whether your orders are being hit. Keep in mind that limit orders are, by default, cancelled once the conditions for entry are no longer true - which, in this case, would occur if the order has not been filled by the bar after the first bar of the session.

    I'd take a look at this example which shows how to keep an order alive until it is explicitly cancelled:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Lopat,

      Originally posted by Lopat View Post
      Hello Ninjatrader,
      i want to develop a strategy which trades morning revearsals.
      But my strategy anazlyser get no result.
      I would like to express the following with the strategy: - if the first candlestick of the current day opens between 3 and 10% higher, a limit should be set slightly higher (0.5%) than the previous day.
      GapUpPriorDayHighRangeLow = 1.03;
      GapUpPriorDayHighRangeHigh = 1.1;

      // Set 1
      if ((Bars.IsFirstBarOfSession == true)
      && ((Open[0] * GapUpPriorDayHighRangeLow) >= Close[1])
      && ((Open[0] * GapUpPriorDayHighRangeHigh) <= Close[1]))
      {
      EnterLongLimit(Convert.ToInt32(TradeSize), (PriorDayOHLC1.PriorHigh[0] * LimitüberPriorHigh) , "");
      }
      ...
      Robin
      A. Gap Up
      Are you really testing is the new day is opens with a gap up, if you multiply the Open with a factor > 1 and then compare the result with yesterday's Close?
      This condition can evaluate to true if today's Open is smaller than yesterday's Close.

      B. Inconsistent conditions
      How likely is it that
      Today Open * 1.03 is >= Close [1], but
      Today Open * 1.10 is <= Close [1]?

      C. Reverse Conditions
      Perhaps you want to check instead, if
      Today Open >= (Close[1] * 1.03) &&
      Today Open <= (Close[1] * 1.10)?

      NT-Roland
      Last edited by NT-Roland; 05-14-2021, 09:00 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      6 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      2 views
      0 likes
      Last Post DanielTynera  
      Started by yertle, 04-18-2024, 08:38 AM
      9 responses
      41 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by techgetgame, Yesterday, 11:42 PM
      0 responses
      12 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Working...
      X