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.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Blocking Multiple Order Signals
Collapse
X
-
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.
Tags: None
-
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
-
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
-
imported post
scjohn - do you mind sharing the part of the code which deals with blocking out multi entries?
Comment
-
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
-
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
by jeronymite
Today, 10:10 PM
|
||
Started by bill2023, Today, 08:51 AM
|
2 responses
16 views
0 likes
|
Last Post
by bill2023
Today, 10:10 PM
|
||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
167 responses
2,260 views
0 likes
|
Last Post
by jeronymite
Today, 09:54 PM
|
||
Started by warreng86, 11-10-2020, 02:04 PM
|
7 responses
1,362 views
0 likes
|
Last Post Today, 09:41 PM | ||
Started by Perr0Grande, Today, 08:16 PM
|
0 responses
5 views
0 likes
|
Last Post
by Perr0Grande
Today, 08:16 PM
|
Comment