Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit help+suggestion

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

    exit help+suggestion

    hello,I need some help
    1---I want to know if it's possible to make this condition on builder: exit on first profitable canddle / exit after 4th canddle in profit or loss
    2---can you suggest me an indicator on nt8 to identify the low and the highs of a canddle....for example i want to build a strategy on builder with theses simple rule : buy if close is lower than previous last 3 lows ,and close position(sell) if price close above or equal the 3 last highs
    thanks for any help

    #2
    1 - it is possible, and, quite easily:

    Code:
    if (BarsSinceEntryExecution == 3) // 4th bar after Entry
    {
    // Your exit logic;
    }
    Code:
    if(Position.GetUnrealizedProfitLoss(PerformanceUnit.Points, Close[0]) > 0) // Profit/Loss > 0
    {
    // Your exit logic;
    }
    2 - I don't know of such indicator, but a simple if statement would do:

    Code:
    if (Close[0] < Low[1] && Close[0] < Low[2] && Close[0] < Low[3]) // Current close is lower than 3 last lows.
    {
    // Your buy logic;
    }
    Code:
    if (Close[0] >= High[1] && Close[0] >= High[2] && Close[0] >= High[3]) // Current close is equal or higher than 3 last highs.
    {
    // Your sell logic;
    }

    Comment


      #3
      Hi janio973, thanks for posting. There is a collection of example conditions the builder can make here:


      The "Strategy" folder has several account related things you can use e.g. Current Market Position, Unrealized PnL, and BarsSinceEntryExecution e.g.


      The builder can read the Low and High price arrays e.g.



      Please let me know if you have any questions.

      Comment


        #4
        thanks a lot UltraNIX and NinjaTrader_ChrisL for your precious help ,im going to work on all that
        have a nice day

        Comment


          #5
          thats working ,gracias guys
          Attached Files

          Comment


            #6
            Great results. What timeframe and instrument are you using?

            Comment


              #7
              this is NQ 9mn timeframe,yeah good results,but it needs more contract or another strategy to make a living from it
              Last edited by janio973; 04-19-2022, 01:50 PM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              62 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              134 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X