Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Filter out ticks from order processing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Filter out ticks from order processing

    I'm trying to filter out ticks in historical data that are spikes on a 1 tick chart.

    I want to do this by editing the FillType and somehow reference the price of the last bar. How do I do this? All I see is NextLow and NextHigh. I tried caching it as LastNextLow, but it didn't seem to work.

    Also, where can I find a list of methods that can be overridden for Strategy.cs? And where on the filesystem is Strategy.cs?

    Thanks!

    #2
    uprz23, I will have someone get back to you tomorrow.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Ok I think I figured it out. I added.

      Code:
      	[Gui.Design.DisplayName("Default")]
      	public class DefaultFillType : FillType
      	{
      		private		const double	epsilon			= 0.00000001;
      		private double lastPrice = -1; // cache the last price
      		
      	
      		public override void Fill(Order order)
      		{ 
       
      		...
      	        if (((order.OrderAction == Cbi.OrderAction.Buy && order.LimitPrice > nextLow + epsilon  )
      						|| (order.OrderAction == Cbi.OrderAction.BuyToCover	&& order.LimitPrice > nextLow + epsilon )
      						|| (order.OrderAction == Cbi.OrderAction.Sell			&& order.LimitPrice < nextHigh - epsilon  )
      						|| (order.OrderAction == Cbi.OrderAction.SellShort	&& order.LimitPrice < nextHigh - epsilon)) 
      						&& Math.Abs(NextLow - lastPrice) < 0.05   // ignore ticks 5 cents from last tick
      						)
      					FillPrice = order.LimitPrice;		
      					
                      ...
                     lastPrice = NextLow;
      I hope there will be no multithread timing issues here.
      Last edited by uprz23; 06-12-2011, 08:57 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pechtri, 06-22-2023, 02:31 AM
      6 responses
      116 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by birdog, 01-25-2023, 08:10 PM
      2 responses
      158 views
      1 like
      Last Post RickAce
      by RickAce
       
      Started by stafe, 04-15-2024, 08:34 PM
      12 responses
      59 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by benmarkal, Today, 12:52 PM
      0 responses
      5 views
      0 likes
      Last Post benmarkal  
      Started by Tim-c, Today, 03:54 AM
      3 responses
      13 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X