Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Find EntryPrice Realtime

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

    Find EntryPrice Realtime

    Hello to the forum,

    I want to calculate the entry of a position and have successfully completed the historical part.
    Therefore I am aware that I have to respect different conditions for the entry signal and the sequence signal.

    Realtime I still have problems. I cannot understand which entry price I have to use.
    In my opinion, the CurrentAsk would be correct if the entry condition is given.
    Currently I work with Close [0], which is most often correct.
    This usually works but not always; attached an tick - evaluation.

    12.09.2019 13:59:00 Close[0] 12418 Close[1] 12419 Open[0] 12418,5 Open[1] 12427,5 mybid 12417,5 myask 12419 calcEntryPriceLong 12418,5 tradedEntryPriceLong 12419,5

    12.09.2019 14:06:00 Close[0] 12417,5 Close[1] 12417 Open[0] 12417,5 Open[1] 12428,5 mybid 12416,5 myask 12417,5 calcEntryPriceLong 12417,5 tradedEntryPriceLong 12417,5

    tradeEntryPriceLong equals Position.AveragePrice (green Target and Stopp)










    At 13:59, the tradedEntryPrice (Entry from NT8) is derived neither from
    the current or previous Close, the current or previous Open or from the Current ASK / BID !?

    So my question: What is the correct starting price in a real-time position?

    I am aware that the calculation of the entry price also depends on the fill of the position.
    Currently I calculate and simulate.
    I'll deal with the necessary adjustments in live trading later.
    In any case, the programming must be correct first.

    THANK YOU!



    #2
    use the OnExecutionEvent and capture it. its your best source for the executed price.
    Attached Files

    Comment


      #3
      Hello user10, thanks for your post.

      The OnExecutiaonUpdate event will let you get the entry price for your orders right when they are executed. We have a reference sample here that shows how to use OnExecutionUpdate and OnOrderUpdate.here.

      Please let me know if I can assist any further.

      Comment


        #4
        Thanks for the hint.

        If I understand correctly, my problem is not solved.

        My calculations should concern both long and short strategies.
        How could onOrderUpdate (Long) help?

        Currently I'm testing with a limit order on GetCurrentBid ();
        the results will be better, but they are not always correct.

        Many thanks for the support!

        Comment


          #5
          Hello user10, thanks for your reply.

          OnExecutionUpdate has a "marketPosition" property that you can use to tell if the execution made the account long or short. You could also use the signal name to identify your orders in a more customized way. The Execution object that is passed to OnExecutionUpdate holds a Name property that can be used.

          Please let me know if I can assist any further.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          67 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          142 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          76 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          47 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          51 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X