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.

      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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          22 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          21 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          181 views
          0 likes
          Last Post jeronymite  
          Working...
          X