• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IExecution - is there inconsistency?

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

    IExecution - is there inconsistency?

    Maybe there is an inconsistency in the IExecution class...

    It contains property MarketPosition, which can have 3 possible values:
    • Long // this looks logical, if execution was in Long direction
    • Short // this looks logical, if execution was in Short direction
    • Flat // this does'n give me any sense for execution


    Execution is always filled in Long or Short direction. Cannot be filled in "Flat" direction. But the API says, it is potential value for execution.

    Flat position is logical in context of measuring position for the whole strategy,
    but does not make sense in context of execution. API provides invalid potential values and users can expect and check execution against Flat value, which is logical nonsense introduced by not best API design.

    I suggest, we need right enum called:

    HTML Code:
    enum Direction{
        Long, Short
    }
    which would be ideal for all purpose, where we need to express something with direction.

    In case the MarketPosition enum was used to simply reuse some existing type,
    it is wrong reuse, which leads to invalid and misleading concept, that execution direction
    can be Flat. In my opinion, this is nonsense and should be fixed.

    Best regards
    Misova
    Last edited by misova; 01-04-2015, 10:41 AM.

    #2
    Originally posted by misova View Post
    Maybe there is an inconsistency in the IExecution class...

    It contains property MarketPosition, which can have 3 possible values:
    • Long // this looks logical, if execution was in Long direction
    • Short // this looks logical, if execution was in Short direction
    • Flat // this does'n give me any sense for execution


    Execution is always filled in Long or Short direction. Cannot be filled in "Flat" direction. But the API says, it is potential value for execution.

    Flat position is logical in context of measuring position for the whole strategy,
    but does not make sense in context of execution. API provides invalid potential values and users can expect and check execution against Flat value, which is logical nonsense introduced by not best API design.

    I suggest, we need right enum called:

    HTML Code:
    enum Direction{
        Long, Short
    }
    which would be ideal for all purpose, where we need to express something with direction.

    In case the MarketPosition enum was used to simply reuse some existing type,
    it is wrong reuse, which leads to invalid and misleading concept, that execution direction
    can be Flat. In my opinion, this is nonsense and should be fixed.

    Best regards
    Misova
    On the face of it, what you say is right, but actually your argument is not quite correct. What about if you are long and issue an opposite order for the same quantity? Answer: You go flat. Of what utility is that? Depends on what one wants to know.

    Regardless, there is an Execution scenario that results in a flat position. What one may want to do with that information is a different kettle of fish. One scenario is in handling overfills, when one is doing so manually, because one has used the IgnoreOverfill = true; directive.
    Last edited by koganam; 01-04-2015, 12:08 PM.

    Comment


      #3
      Hello misova,

      Thank you for your post.

      IExecution is for the OnExecution() method, so this means when an execution report is provided. MarketPosition in this case pulls the position of the strategy when the execution report was provided, not the position the execution is intended to take or the side it is intended - i.e. Buy, Sell, Sell Short, Buy To Cover.

      You would want the execution.Name for information on the side the execution is for. So using signalNames that provide information on the order is helpful, such as "entryLong1" or "exitShort" for example.
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Thanx,

        it is good to know, what MarketPosition really means in context of execution =
        that is it a snapshot of strategy position in time of execution. It makes a sense after explicit definition you provided,

        but the API help says, that possible values are Long or Short.,
        which makes logical to think of it as direction of execution.

        PROPOSAL 1:
        The help should be updated with proper definition and required detail.


        Here is the screen from latest version of Help in NinjaTrader:



        I think, we all would like to have elegant and professional API, so I have one more suggestion for development team.

        PROPOSAL 2:
        The execution should contain such fundamental information as the direction of execution is.


        It would be much more elegant to get that info from right property (like IExecution.Direction for example) instead of parsing such a basic information from string IExecution.Name. I would say, this could be really improved, becasue it does not fit for
        an elegant and professional API.
        Attached Files

        Comment


          #5
          Hello Misova,

          Thank you for your response.

          1. The value would be the Market Position, this would not mean the direction of the order.

          2. When an order is placed there is nothing that indicates it is to enter or exit. There is Long or Short in terms of the side the order is placed to, but this would be determined when you set the entry or exit method.

          You can use execution.Order.OrderAction to determine the action of the order though: http://www.ninjatrader.com/support/h...nt7/iorder.htm
          Patrick H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by fluffier, Yesterday, 11:49 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by GARZONJ, Yesterday, 09:02 PM
          0 responses
          2 views
          0 likes
          Last Post GARZONJ
          by GARZONJ
           
          Started by bouncetherubble, Yesterday, 08:42 PM
          0 responses
          3 views
          0 likes
          Last Post bouncetherubble  
          Started by connorgrant5, Yesterday, 01:33 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by Mykro, Yesterday, 01:28 PM
          7 responses
          17 views
          0 likes
          Last Post Mykro
          by Mykro
           
          Working...
          X