• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 tgn55, Today, 08:57 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post tgn55
                  by tgn55
                   
                  Started by chartish, Today, 04:43 PM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_EricB  
                  Started by Trader17, Today, 04:07 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Trader17  
                  Started by GussJ, Today, 01:30 PM
                  2 responses
                  20 views
                  0 likes
                  Last Post GussJ
                  by GussJ
                   
                  Started by GARZONJ, Today, 12:25 PM
                  3 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Working...
                  X