NexusFi: Find Your Edge


Home Menu

 





What is going on here (my strategy isn't producing orders) ????


Discussion in NinjaTrader

Updated
    1. trending_up 4,699 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

Fellow Brothers & Sisters NinjaTrader Traders,

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


Attached Thumbnails
Click image for larger version

Name:	adviseOnThisPlease.jpg
Views:	291
Size:	245.1 KB
ID:	39921  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
Pakistan Mediator in Tehran as Hormuz Normalization Coll …
Prediction Markets & Event Contracts
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


Sorry I don't what the issue is off the top of my head. What is the rest of the error message, it's cut off in your screenshot.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

{ 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,

JME


Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557

Your code seems to be missing some things, like tracking the IOrder value for new positions on EnterLong/EnterShort.

Here is some old code I used for a strategy that uses iorders:

 
Code
                            
        private void GoLong()

        {
            
entryorder     EnterLongLimit(0trueDefaultQuantityMath.Min(Close[0], GetCurrentAsk()), "Buy (" CurrentBar ")");
            
entrybar    CurrentBar;
            
SetProfitTarget("Buy (" CurrentBar ")"CalculationMode.TicksTarget);
            
SetStopLoss("Buy (" CurrentBar ")"CalculationMode.TicksStopfalse);
        } 
Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
jmejedi's Avatar
 jmejedi 
Lilburn, GA
 
Experience: Beginner
Platform: NinjaTrader
Broker: VelocityFutures/TT
Trading: ES
Posts: 62 since Jan 2011
Thanks Given: 13
Thanks Received: 4

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 ? ? ? ?


Started this thread Reply With Quote




Last Updated on June 7, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts