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 Mindset, 04-21-2026, 06:46 AM
              0 responses
              93 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              138 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              68 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              123 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              73 views
              0 likes
              Last Post PaulMohn  
              Working...
              X