Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Engulfing or partial Engulfing

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

    Engulfing or partial Engulfing

    Excuse me,

    on the forum, where may I find a simple Ninja strategy checking whether the price crosses above the close of the previous bullish bar or below the open of a previous bullish one ?
    (This somehow corrisponds to verify if an Engulfing occurs not on both sides of the previous bar/candle, but just on one side. However, a normal Engulfing strategy is eventually also good).
    I implemented the attached code by myself, but it presents 2-3 issues.

    Furthermore, is there a NinjaScript function to show only which row number the code is compiling during its work, thus returning something like 1-2-3.....24-27-30..... ?
    Attached Files
    Last edited by fliesen; 04-09-2014, 02:22 AM.

    #2
    fliesen, perhaps check into the CandeStickPattern indicator we ship per default with NT, it would allow for detecting such patterns as well and be able to get called in a strategy, too.



    I don't really follow your last question on the compile rows, if there is an issue the present NT editor will already note the row / column for you, you can just doubleclick on the error and it will directly take you to the offending code line then to review / fix / comment out.

    Comment


      #3
      With CalculateOnBarClose=false option in Initialize function, i think you can check for following conditions

      Close[1] > Close[2] //prev bar was bullish

      Close[0] > Close[1] // current price is above the close of prev bar

      Use print statement to debug the code.

      Comment


        #4
        Your default Candlesticks indicators are separated for Bullish and Bearish Engulfing. On the contrary, I need a code that always informs me whenever an uptrend or a downtrend may be reversing (when a candle overshadows an opposite candle, this is always an important warning for a possible trend change).
        Since I may edit a NinjaScript strategy, but not an indicator, how may I translate the indicator into a code snippet ?
        Alternatively, how may I ask if someone in the forum has already developed a whichever NinjaScript looking for crosses between price and open / close bar values ?

        As to my last question, I don't need to find errors, but the row (= logical) sequence of how the algorythm is working (for istance which if-statements are triggered and which are not). I know this is possible even with Prints and Alerts, but it would be much simpler with a proper trace function, as other languages have.

        Comment


          #5
          You can edit both NinjaScript indicators and strategies, you can make yourself a copy of the system indicator and then work on modifying to suit your needs.

          Correct, you would need Prints in this case or an advanced technique such attaching to VS to debug in detail with breakpoints - http://www.ninjatrader.com/support/h..._debugging.htm

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X