Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trading a tick too late

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

    Trading a tick too late

    I'm using custom Tick data to backtest a strategy. The ticks are ticks based on when price goes up 1%, or down 1%. So it's like a rangebar based on percentage instead of points.

    We have a problem that whenever we call EnterLong(), the simulator will buy at the price of the Next tick. In our case this differs 1%, as the price has moved another 1% up or down.

    Overall this means we have a problem which could be solved by 2 different solutions:

    A: Is there a setting that goes long/short on the tick you call the function instead of the next?

    Or B: Are there ways to change range bars to percentages instead of points? How would one go to implement this kind of bar behavior?

    #2
    CalculateOnBarClose is set to true or false?

    Comment


      #3
      Both TRUE and FALSE give the same results.

      We are only backtesting the strategy btw.


      Print("Enter Long at Price: " + Close[0]);
      EnterLong();

      The result in the log is ONE tick BEFORE the actual price that it buys and sells.
      Last edited by connex; 02-22-2014, 04:09 PM.

      Comment


        #4
        Hello connex,

        Thank you for your post.

        Backtesting is done on historical data, which means that the tests are done on the close of the bar as the historical data is only the open, high, low and close of the bar and not every tick that built the bar. So in backtesting we see conditions calculated on the close of the bar, resulting in the actions be taken on the next bar.

        It is possible to simulate intra-bar fills but the calculations would still be done on the close of the bar. You can also look at using a smaller interval such as 1 tick to attempt to calculate intra-bar as well. The following link will take you to our reference sample on simulating intra-bar fills: http://www.ninjatrader.com/support/f...ead.php?t=6652

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Radano, 06-10-2021, 01:40 AM
        20 responses
        616 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Mizzouman1, Today, 07:35 AM
        0 responses
        4 views
        0 likes
        Last Post Mizzouman1  
        Started by i019945nj, 12-14-2023, 06:41 AM
        6 responses
        66 views
        0 likes
        Last Post i019945nj  
        Started by aa731, Today, 02:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by BarzTrading, Today, 07:25 AM
        0 responses
        3 views
        0 likes
        Last Post BarzTrading  
        Working...
        X