Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
What is going on here (my strategy isn't producing orders) ????
I have the following interesting situation with my strategy that I am testing on a market replay on the ES on a 1-tick chart:
My strategy isn't submitting any orders , I have tried to widen my tolerance for accepting the condition/moment to allow an entry into position , I believe my code is sound enough to allow multiple chances throughout the trading day to submit orders , and nonetheless my strategy isn't producing and/or cancelling orders . Below is code I have for my OnBarUpdate method:
// Update tracking of positioning & 'etc' . That is, let's see where are we approxmately in these two lines
// and calculate how many are behind us .
if(XXXXXXX == true){
//stuff-here
}
//
//
// Check to see if Best Bid & Best Ask volumes are close enough , and if so , then check and see if you "may"
// submit limit orders . If everything looks good then proceed with submitting two limit orders ; and also
// start with keeping track of your positioning & 'etc' . Make sure to ensure that afterwards we cannot submit
// anymore orders (until these get filled and/or cancelled) .
if( Math.Abs(GetCurrentAskVolume() - GetCurrentBidVolume()) <= closeEnough && XXXXXXX == false ) {
//stuff-here
enteredBuyPrice = GetCurrentBid();
enteredSellPrice = GetCurrentAsk();
currentBuyOrder = EnterLongLimit(enteredBuyPrice);
currentSellOrder = EnterShortLimit(enteredSellPrice);
//stuff-here
XXXXXXX = true;
}
//
//
// Check and see if limit orders got filled , and if so , then let's look for next opportunity to enter , Or let's
// simply make note of which one did get filled .
if(XXXXXXX == true){
if(currentBuyOrder != null && currentSellOrder != null){
if(currentBuyOrder.OrderState == OrderState.Filled
&& currentSellOrder.OrderState == OrderState.Filled) {
currentBuyOrder = null;
currentSellOrder = null;
XXXXXXX = false;
}
}
if(currentBuyOrder != null){
if(currentBuyOrder.OrderState == OrderState.Filled) {
currentBuyOrder = null;
}
}
if(currentSellOrder != null){
if(currentSellOrder.OrderState == OrderState.Filled) {
currentSellOrder = null;
}
}
if(currentBuyOrder == null && currentSellOrder == null) {
XXXXXXX = false;
}
}
//
//
// Determine whether or not to pull-out & if so then do so .
if(XXXXXXX == true){
if(currentBuyOrder == null && currentSellOrder != null && GetCurrentAsk() < enteredBuyPrice){
EnterShort();
CancelOrder(currentSellOrder);
currentSellOrder = null;
XXXXXXX = false;
}
if(currentSellOrder == null && currentBuyOrder != null && GetCurrentBid() > enteredSellPrice){
EnterLong();
CancelOrder(currentBuyOrder);
currentBuyOrder = null;
XXXXXXX = false;
}
}
Please see attached screen-shot , which may explain why my strategy isn't working .
{ the exact wording on these 2 entries seen in the log being shown on this screen-shot, follows:
6/1/2011 8:21:21 AM Strategy An Enter() method to submit an entry order at '5/25/2011 12:01:09 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.
6/1/2011 8:21:21 AM Strategy Enabling NinjaScript strategy 'HMHFT/c199bc43d71b4505819151a87ecab9c1' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositions ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
}
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, furthermore... I would like to add the following FYI on top of the above:
I am running this off of a Windows Server 2003 (R2 Service Pack 2 Enterprise Edition) 32-bit with RAM: 1024 MB
. . . . . . . also ,,,,,, question(s):
Should I be setting any special setting within my Initialize method of my strategy? Maybe indicating unmanaged-orders v.s. managed-orders??
Do you think its a performance issue? Maybe my hardware/software isn't fast enough??
Thanks in advance for any help you may provide me ,
Jimmy M. Espana
Can you help answer these questions from other members on NexusFi?
{ the entire wording on these 2 errors seen in the log being shown on this screen-shot, follows:
6/1/2011 8:21:21 AM Strategy An Enter() method to submit an entry order at '5/25/2011 12:01:09 AM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.
6/1/2011 8:21:21 AM Strategy Enabling NinjaScript strategy 'HMHFT/c199bc43d71b4505819151a87ecab9c1' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
thanks BigMike for your reply ....................................... moreover,,, i contacted NT Support regarding this matter . . . and it turned out ,,,,,,, that a "unmanaged" way of doing things, for my particular coding strategy objective, was needed to be done on my existing coding for my said strategy . . . . . . . so anyway,,, I proceed with dong the changes,,, and finally got around to getting my code to execute orders... submitting/cancelling...... "the works", as it relates to my strategy idea . . . . . . . . . . . . . . . . . since then,,,, I've been testing my strategy on market-replay data...... and its turning out a profit , , , apparently constantly ........ but commissions would be killing me . . . . . hence, now I'm thinking, maybe its a muscle-power situation . . . . . . . . . . . . . . . . . . I'm running this off of the cheapest muscle-power that Rackspace Cloud has to offer ,,,, now my new question . . . . . what if I go with the best muscle-power Rackspace Cloud has to offer . . . . . would that improve my strategy's profit turn-out ? ? ? ?