Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry price of ES is not by tick. Is there a way to work around it?

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

    Entry price of ES is not by tick. Is there a way to work around it?

    Hi,

    I wrote some codes to sum up daily realized profit.

    Code:
            foreach (Trade i in Signals)
            {
                if (ToDay(i.Entry.Time)==BarDate)
                {
                    DailyPnL = DailyPnL + i.ProfitPoints;
            PrintWithTimeStamp(Convert.ToString(i.ProfitPoints));
            PrintWithTimeStamp(Convert.ToString(i.Entry.Price));
    
                }
    And I found that the ProfitPoints are not in ticks. Then I chased and found that it is caused by entry price of the trade. Like the entry price below, entry price is a long number. This is in practice not possible.

    5/21/2012 09:59:56 1296.10453342885

    Is there a work around of this, so that I get more realistic entry price in back testing?

    #2
    Hello,

    If you are scaling in or out of your strategy, your avg price may be reported in this manner.

    However you can use Round2TickSize in your strategy logic to get the closest tick value of the instrument you are trading.

    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Hello,

      If you are scaling in or out of your strategy, your avg price may be reported in this manner.

      However you can use Round2TickSize in your strategy logic to get the closest tick value of the instrument you are trading.

      http://www.ninjatrader.com/support/h...trument_ro.htm
      I used the following statement to enter. It does generate a limit price of non-rounded number:

      Code:
      EnterLongLimit(DefaultQuantity, Bollinger(2.5, 14).Upper[0], "abc");
      does this non-rounded to tick limit order mess up execution in real live? I have not reached there yet so hope that you can share experience about it.


      also, There is only MasterInstrument.RoundPrice(price, increment) in my NT7, no Round2TickSize function. My NT7's version is 7.0.1000.10. Is that a problem? I can't find reference on what "increment" should be. Could you advise what I should fill in?

      Comment


        #4
        Hello leontancfa,
        Thanks for your post and I am replying for Matthew.

        The unsupported Round2TickSize is not broken in version 7.0.1000.10. Please use the below code to round to ticksize
        Code:
        Instrument.MasterInstrument.Round2TickSize(price);
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        37 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        62 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X