Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Blocking Multiple Order Signals

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

    Blocking Multiple Order Signals


    I know once an OIF entry signal order is filled through the strategy manager and is running a position strategy for the security inquestion the strategy manager will not accept a new strategy for the same security until the first oneis eithercanceled or cleared. That’s good - I wonder once thefirstOIF entry signal is sentand the order is pending is there a way to block all other incoming OIF entry signals for the same security until that order is either canceled or cleared through the strategy manager? The reason I'm asking is I would like it so that once the first order is sent and pending NT won't keep excepting and sending pending orders for the same security when all I want is the first OIF signal placed and played out for that security, thus in turn blocking secondary OIF signals until the first one has been either canceled or has played out through the strategy manager.



    #2
    imported post

    It does block any futher Order OIF for that security, does it not?
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      ok friday when we were testing things - a trade signal was sent and a pending order was waiting to be filled, when that order was pending another signal was generated on are chart, and that order also was sent thru to be filled, thus we had two orders pending at once. I Know could have been wrong because we are green to this application right now and we are learning something new ever day but I'm pretty sure it did. I will keep tabs on this this week and let you know what happens.






      Comment


        #4
        imported post

        I had to add code to my own code to block (keep from sending) multiple signals (OIF orders).

        Comment


          #5
          imported post

          scjohn - was it code added to the OIF file? Or was it code added to your automation strategy? If it was to the OIF code do you mind sharing it either by posting it or sending it to me in an email? And if the code was addedto the strategy do you mind if I ask what application or code you used to create your strategy with?

          Thanks Any help would be appreciated

          Comment


            #6
            imported post

            I added the code to the strategy it self. Strategy is written in Esignal's EFS (javascript).

            Comment


              #7
              imported post

              scjohn - do you mind sharing the part of the code which deals with blocking out multi entries?

              Comment


                #8
                imported post

                Here is the revleant code. The key is the variable: SignalCntr.

                Code:
                 // Kick things off by seeing if STTB say time to go long
                 bIsNewCO = false;
                 if( (STTB[0] > 0.00) && (PrevSTTB <= 0.00) ) {
                 bIsLong = true;
                 bIsShort = false;
                 bIsNewCO = true;
                 SignalCntr = 0;
                 } else if( (STTB[0] < 0.00) && (PrevSTTB >= 0.00) ) { // seeing if STTB say time to short
                 bIsLong = false;
                 bIsShort = true;
                 bIsNewCO = true;
                 SignalCntr = 0;
                 }
                 //debugPrintln("bIsLong(" + bIsLong + ") bIsShort(" + bIsShort + ") bIsNewCO(" + bIsNewCO + ") SCntr: " + SignalCntr);
                 if(bIsLong) {
                 if( (close(-1) >= a900) && (close(-1) >= Split115) && (HL == 1.0) && (WL == 1) ) {
                 SignalCntr = SignalCntr + 1;
                 if (SignalCntr == 1) { // issue order only of the 1st signal
                 Order = "BUY"; //set the order to Buy
                 LmtPrice = GetLimitPrice(frLMTSTP); //get the Limit PRice
                 // set up the alert message
                 AlertMsg = AlertMsg + "Hermes " + Order + " Signal. Signal price: " + formatPriceNumber(LmtPrice) ;
                 AlertBG = COColor;
                 bIsAlert = true;
                 // does the user want to plot the alert 
                 if (frGraphic == "T") {
                 offset = (high(-1) - low(-1)) / 2.0;
                 drawShapeRelative(-1, high(-1) + offset, Shape.UPARROW ,null , COColor, Shape.TOP | Shape.ONTOP );
                 }
                 // turn on new trade only in real time
                 if(getCurrentBarIndex()== 0) bIsNewTrade = true;
                 COBar = getCurrentBarIndex();
                 }
                 }
                 }
                 if(bIsShort) {
                 if( (close(-1) <= a900) && (close(-1) <= Split115) && (HL == -1.0) && (WL == -1) ) {
                 SignalCntr = SignalCntr + 1;
                 if (SignalCntr == 1) { // issue order only of the 1st signal
                 Order = "SELL"; //set order to Sell
                 LmtPrice = GetLimitPrice(frLMTSTP); //get the Limit PRice
                 //set up the alert message
                 AlertMsg = AlertMsg + "Hermes " + Order + " Signal. Signal price: " + formatPriceNumber(LmtPrice);
                 AlertBG = CUColor; 
                 bIsAlert = true;
                 // does the user want to plot the alert
                 if (frGraphic == "T") {
                 offset = (high(-1) - low(-1)) / 2.0;
                 drawShapeRelative(-1, low(-1) - offset, Shape.DOWNARROW ,null , CUColor, Shape.BOTTOM | Shape.ONTOP);
                 }
                 // turn on new trade only in real time
                 if(getCurrentBarIndex()== 0) bIsNewTrade = true;
                 COBar = getCurrentBarIndex();
                 } 
                 }
                 }

                Comment


                  #9
                  imported post

                  Thanks scjohn I will take a look the code later today. Good trading - and again thanks for the code

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  40 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Today, 08:51 AM
                  2 responses
                  16 views
                  0 likes
                  Last Post bill2023  
                  Started by sidlercom80, 10-28-2023, 08:49 AM
                  167 responses
                  2,260 views
                  0 likes
                  Last Post jeronymite  
                  Started by warreng86, 11-10-2020, 02:04 PM
                  7 responses
                  1,362 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by Perr0Grande, Today, 08:16 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Perr0Grande  
                  Working...
                  X