NexusFi: Find Your Edge


Home Menu

 





MTF trouble with EntriesPerDirection


Discussion in NinjaTrader

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




 
Search this Thread

MTF trouble with EntriesPerDirection

  #1 (permalink)
 jordis 
Mobile, Alabama
 
Experience: Beginner
Platform: NinjaTrader, TOS
Trading: Stocks
Posts: 29 since Sep 2011
Thanks Given: 6
Thanks Received: 3

OK, so I've got an mtf strategy that looks for a condition to be met on a 5 minute indicator, once that condition is met the strategy looks for another condition to be met on a 1 minute indicator. When both of these are true, the strategy begins entering trades once per minute until either condition is no longer met.

This much of it works just fine.

Well, after exporting 12 years worth of trades to excel and running many hours of low-tech, excel-based analysis, I have come to the conclusion that after a certain number of entries in one direction (ie. # of trades entered with the 5 minute condition being met) the odds of profit/success rapidly fall off a cliff (<50%). So, what I want to do is to limit my number of entries to a fixed amount under the 5 minute condition. Once the max entries has been reached, I want to wait until the 5 minute condition resets and is met again.

With what I have so far I am accidentally only limiting my EntriesPerDirection for the 1 minute time frame. This means that if the 5 minute condition stays met and the 1 minute condition cycles on and off I keep entering into trades in blocks of my maximum EntriesPerDirection. I guess what I'm really doing is setting EntriesPerDirection on the 1 minute scale and not the 5 minute scale.

So, can anyone possibly help me figure out what I need to do to limit my EntriesPerDirection under the 5 minute time frame condition instead of the 1 minute?

Below are the basic bones of my code.

 
Code
protected override void Initialize()
      {
	
		EntriesPerDirection = 5; // So I'm guessing this isn't where I need to set my EntriesPerDirection
     		EntryHandling = EntryHandling.AllEntries; 
		Add(PeriodType.Minute, 5); 
                Add(WMA(3));
		Add(WMA(6));
                Add(WMA(10));
                Add(ADX(8));
		CalculateOnBarClose = true;
        }

 
        protected override void OnBarUpdate()
       
		
		{
	    //trades are opened and closed on the primary time frame, which is 1 minute		
            if (BarsInProgress == 0)
				
    {				
		
            {
                //Exit all trades after a fixed amount of time.
            	ExitLong("c"+Time[-1], "long"+Time[10]);
		ExitShort("c"+Time[-1], "short"+Time[10]);
            }
	
				
           
            //This part is the stripped down version of my code to enter long positions. 
    
              if (5 minute condition)
              {
		if(1 minute condition)
       		   {

                    EnterLong(DefaultQuantity, "long"+Time[0]);
		    SetStopLoss("long"+Time[0], CalculationMode.Percent, stopLoss , true);					
                }
        }	}
	}        // This part is the stripped down version of my code to enter short positions.
		 if (5 minute condition)
                  {
                    if(1 minute condition)
                     {

                    EnterShort(DefaultQuantity, "short"+Time[0]); 
		    SetStopLoss("short"+Time[0], CalculationMode.Percent, stopLoss , true);
                }
        }	
          
    }
    }

I appreciate the help,
Jordis

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Spoo-nalysis ES e-mini futures S&P 500
14 thanks
  #3 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


Maybe create a counter, something like

if (5 minute condition)
{
counter[0] = 0
if(1 minute condition && counter[0]<=5)
{
EnterLong(DefaultQuantity, "long"+Time[0]);
SetStopLoss("long"+Time[0], CalculationMode.Percent, stopLoss , true);
counter[0] = counter[1]+1;
}

Reply With Quote




Last Updated on December 10, 2012


© 2024 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 - Privacy Policy - Downloads - Top
no new posts