Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

COBC true - immediate entry

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

    COBC true - immediate entry

    Hello,

    I need to work with COBC=true but I want to have an immediate entry.
    (it works with COBC=false and firsttickofbar, but because of an indicator I have to change to COBC=true)

    With these conditions the entry is only the next bar and not immediate with a click on the button (as I can do with COBC=false)

    if (_stratON && _exits.Text == _onMessageM
    && BarsInProgress == 0
    && GetCurrentAsk() > GetCurrentBid())

    How can one have immediate entry when COBC=true? I mean which condition to set (the control and action I do with my buttons)

    Thank you.

    Best regards
    Tony
    Last edited by tonynt; 11-15-2013, 02:24 AM.

    #2
    Tony, sounds to me then like you would need to look into processing / sending the order outside of OnBarUpdate() since only that would be driven by the COBC logic - if you need an indicator value though you would need to wait on the update again to come in as your indicator would otherwise not have evaluated. Perhaps a better approach would be working on the indicator to return you the correct values needed in FirstTickOfBar.

    Comment


      #3
      Good morning Bertrand,

      thank you for your reply. This indicator is the first one I let made "outside my rooms" with work of 2 hours by one of your script-consultants. Its counting ask and bid (referring my chat beginning of this week) this is to complicated for me. They told me I have to work with COBC=true (because of what I want to have!)

      So, referring the entry: I had the idea now with a "non-programmers-solution" in the meantime. I add a dataseries with 1 Range size to use in the specific setup and so I can work with COBC=true. The entry is at next "range-size", so almost immediate, this is Ok.

      But there appears another question now: This way it can happen that 2 setups do the entries same time. (I could avoid before with COBC=false and using one dataseries by && firsttickofbar!=true )

      I don´t want to have entries in 2 setups at the same time, this can happen now with COBC=close as my 5Range (dataseries0) can do the entry after close of bar and my 1Range (dataseries1) can do same time. Can I code like "&& FirstTickOfBar(dataseries0) != true"?



      Thanks
      Tony

      Originally posted by NinjaTrader_Bertrand View Post
      Tony, sounds to me then like you would need to look into processing / sending the order outside of OnBarUpdate() since only that would be driven by the COBC logic - if you need an indicator value though you would need to wait on the update again to come in as your indicator would otherwise not have evaluated. Perhaps a better approach would be working on the indicator to return you the correct values needed in FirstTickOfBar.

      Comment


        #4
        Hi Tony, yes adding in a finer series would be an option as well to get a quicker OnBarUpdate() in your case even if likely not as instant as COBC false.

        Yes, you can check with BarsSeries is calling OnBarUpdate() and combine with your FirstTickOfBar call, the BarsInProgress would be what you're looking for. So if you add the 1 range in so that it would be your second series then if (BarsInProgress == 1 && FirstTickOfBar) should do the trick for this scenario.

        Comment


          #5
          Hello Bertrand,

          thanks again for your reply.

          As you have written (BarsInProgress == 1 && FirstTickOfBar) this is what I had done untill now that worked.

          But now I have to add in my setup with dataseries1 that this entry is not triggered when there is also FirstTickOfBar in dataseries0 to avoid 2 entries the same time.
          COBC==true;
          if (BarsInProgress==1 && Closes[1][0]>Lows[1][0]
          && (BarsInProgress == 0 && FirstTickOfBar!=true))

          Can I do this way that the entry with my rangebar1 (dataseries1) is triggered when not at the same time rangebar5 (dataseries0) is FirstTickofBar?


          Thanks
          Tony


          Originally posted by NinjaTrader_Bertrand View Post
          Hi Tony, yes adding in a finer series would be an option as well to get a quicker OnBarUpdate() in your case even if likely not as instant as COBC false.

          Yes, you can check with BarsSeries is calling OnBarUpdate() and combine with your FirstTickOfBar call, the BarsInProgress would be what you're looking for. So if you add the 1 range in so that it would be your second series then if (BarsInProgress == 1 && FirstTickOfBar) should do the trick for this scenario.

          Comment


            #6
            Tony, this statement can only trigger then if the OnBarUpdate() is called from the secondary series.

            if (BarsInProgress == 1 && FirstTickOfBar)

            It would not trigger if FirstTickOfBar is coming from your other, primary series alone.

            Comment


              #7
              Bertrand,

              I know that this would trigger from secondary series. This is what I want. Isn´t this what I wrote(?)

              This entry should be always triggered - except when primary dataseries is also FirstTickOfBar.

              Therefore I have to prevent from entry same time in primary dataseries. And my question is if with "if (BarsInProgress == 0 && FirstTickOfBar)" I can prevent. Does this "FirstTickofBar" in red color refer to primary dataseries - because in the brackets with primary dataseries?

              in words:
              "Do the entry referring setup2 (conditions in secondary dataseries) everytime BUT do not when same time is true setup1 (with conditions in primary dataseries)" . (close of 5Rangebar = primary dataseries. So, eg in an upmove every 5th tick the discretionary entry should not be done - when same time the 5Range has firsttickofbar also)

              (My setup1 is "auto-entry", my setup2 is discretionary entry - if autoentry was not triggered as one of the conditions not met, but I want to do an immediate entry because of other reasons)

              I don´t want to bother, sorry if I caused misunderstanding.

              Best
              Tony

              Originally posted by NinjaTrader_Bertrand View Post
              Tony, this statement can only trigger then if the OnBarUpdate() is called from the secondary series.

              if (BarsInProgress == 1 && FirstTickOfBar)

              It would not trigger if FirstTickOfBar is coming from your other, primary series alone.
              Last edited by tonynt; 11-15-2013, 06:18 AM. Reason: typing error

              Comment


                #8
                Thanks Tony, not bothered at all. I think I follow now, you would want to set a bool then for example if you see the first tick on primary and check this bool in your BIP1 entry we discussed - as otherwise you would not want to enter then on that series. Once entry on BIP1 is done, reset this bool in BIP1. So basically you can only set it to prevent an entry from BIP0, and then take the other entries if they manifest.

                Comment


                  #9
                  Hi Bertrand,

                  don´t need a bool I think (in the meantime I solved it other way - just for info). But even when I could make it working its worth to know about after the thread:

                  The question is please as I´d like to understand how NT works
                  if(Barsinprogress==1
                  && other conditions
                  &&(BarsinProgress==0 &&FirstTickofBar!=true)
                  )
                  if with this bracket and its content I can tell NT that only triggering when FirstTickofBar in BIP0 not true (because in bracket with BIP0, or does FirstTickofBar refer to BIP1 outside the bracket?)

                  Thank you for your support!

                  Best
                  Tony

                  Originally posted by NinjaTrader_Bertrand View Post
                  Thanks Tony, not bothered at all. I think I follow now, you would want to set a bool then for example if you see the first tick on primary and check this bool in your BIP1 entry we discussed - as otherwise you would not want to enter then on that series. Once entry on BIP1 is done, reset this bool in BIP1. So basically you can only set it to prevent an entry from BIP0, and then take the other entries if they manifest.
                  Last edited by tonynt; 11-15-2013, 07:17 AM. Reason: clearify

                  Comment


                    #10
                    Glad to hear Tony, FirstTickOfBar would report in called context, the bar update call you're working in - i.e.

                    if (BarsInProgress == 0)
                    Print(Times[0][0] + " " + BarsInProgress + " " + FirstTickOfBar);

                    if (BarsInProgress == 1)
                    Print(Times[1][0] + " " + BarsInProgress + " " + FirstTickOfBar);

                    What you would not see is BIP0 and 1 getting called together, it would be either one calling for an update, if same timestamp then primary first.

                    Comment


                      #11
                      Bertrand,

                      thank you for your support.

                      Have a great weekend!

                      Best regards
                      Tony

                      Originally posted by NinjaTrader_Bertrand View Post
                      Glad to hear Tony, FirstTickOfBar would report in called context, the bar update call you're working in - i.e.

                      if (BarsInProgress == 0)
                      Print(Times[0][0] + " " + BarsInProgress + " " + FirstTickOfBar);

                      if (BarsInProgress == 1)
                      Print(Times[1][0] + " " + BarsInProgress + " " + FirstTickOfBar);

                      What you would not see is BIP0 and 1 getting called together, it would be either one calling for an update, if same timestamp then primary first.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      88 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      48 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      30 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      34 views
                      0 likes
                      Last Post TheRealMorford  
                      Started by Mindset, 02-28-2026, 06:16 AM
                      0 responses
                      68 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X