Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit After 2 Bars Complete

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

    #16
    I was really asking about this image.

    I don't see option in condition builder for me to compare to 2 like your attachment.

    I've got == indicators, misc, price data, time, user defined inputs (MyInput0), and user Variables ( 0-9)




    Originally posted by TakingStock12 View Post
    From the code you were kind enough to show:

    // Condition set 1
    if (EMA(6)[0] > SMA(14)[0])
    {
    EnterLong(DefaultQuantity, "");
    Variable0 = 2;

    I'm using 7.10000.08 too.

    In condition builder, I went to the "do" portion of set 1 where I have the EnterLong(DefaultQuantity,"") already there, hit the "..." to edit that hoping to enter the "Variable0 = 2" which is showing in your code but I can't figure out how to get the variable to input.
    Attached Files

    Comment


      #17
      Hi Sledge ... I'm getting even more lost here. You found a way to make Ninja exit after 2 bars and posted the conditions thus:
      set1 : if simple (ema>sma).. do: enterlong(defaultquantity, ""), variable0=2
      set2: if BarsSinceEntry()==Variable0, do: exitlong("","");

      I think what I need now, if you don't mind, is a series of screen shots of just how you input those variable values (underlined and bolded above), then I can replicate the input process on my platform. I do not know how to input those variables. If you could walk me through that, I'll be home free I think. It's probably second nature to you, but I can't figure it out.
      I greatly appreciate your patience and willingness to help. Floundering in frustration is no fun at all.


      Comment


        #18
        Oooops, forgot to answer your question, sorry. I was able to input the digit "2" as a point of comparison in relation to the "bars since entry" condition by going to the "misc" tab (where the "bars since entry" option is located) and highlighting "numberic value".

        Comment


          #19
          Originally posted by TakingStock12 View Post
          Hi Sledge ... I'm getting even more lost here. You found a way to make Ninja exit after 2 bars and posted the conditions thus:
          set1 : if simple (ema>sma).. do: enterlong(defaultquantity, ""), variable0=2
          set2: if BarsSinceEntry()==Variable0, do: exitlong("","");

          I think what I need now, if you don't mind, is a series of screen shots of just how you input those variable values (underlined and bolded above), then I can replicate the input process on my platform. I do not know how to input those variables. If you could walk me through that, I'll be home free I think. It's probably second nature to you, but I can't figure it out.
          I greatly appreciate your patience and willingness to help. Floundering in frustration is no fun at all.


          I didn't have to. They were there at the picture. If you click in the field, there is a drop down for variable0-9.



          I don't know of a way to change the names.

          Thanks, I found how you were doing ==2. I've never used the condition builder, I go straight into programming.

          Using your ==2 should work. I'll test that out later on tonight..

          Comment


            #20
            Originally posted by TakingStock12 View Post
            ... that is exactly what I've been trying and backtesting shows trades holding for 3 and 4 bars before exiting due to indicator reversal. Attached screen shots show my condition builder setup for getting out after 2 renko bars complete. Any other ideas? Anyone? Ninja "watchers"?
            Let us reset, if we may. Would you mind posting a picture of a chart output where you see that your conditions are being met, but there is no exit as per your plan?

            Comment


              #21
              I got it! Switched from limit order exit to market which for whatever reason did the trick. While the list of trades still shows trades lasting 3 and 4 bars at times (much better than 30+!!), that apparently includes the entry bar and the open of the bar following the exit signal where the exit actually takes place (after previous bar completes). One of the keys was, indeed, naming the entry and exit strategy conditions and then referring to those names in the Exit conditions.
              Thank you all for all your help!!!! Sledge - you kept me sane (although some would argue a need to first be sane ...). You were all wonderfully responsive! Thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              650 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X