Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create an Alert Log of Position Entry with Price

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

    Create an Alert Log of Position Entry with Price


    https://gyazo.com/21cbbd938847ea51556837149be57a2b


    https://gyazo.com/01a48c2a8e1373e982b6732b1e4d30a9


    trying to create a Alert Log entry for Strategy Position entries I am getting a message but not a Avg Price or entry price or time of the trigger

    the lower link is a screenshot of the action line

    #2
    Hello DTSSTS,
    Thanks for your post.

    Where is this code in your script? (ie OnBarUpdate(), OnPositionUpdate(), etc) Can you provide some more context?

    What time did the entry occur versus what appears on the log? This is an order generated by the same strategy that contains this alert, correct?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      the order and the alert generate as same time. so far as the code i probably dont have what is needed in it " these items are not viewable unless in view code mode, which i do not use ie OnBarUpdate(), OnPositionUpdate(), etc)
      under actions i do not see any choices for those items not after Alert is selected

      Comment


        #4
        DTSSTS,

        Without seeing the code I can only speculate. My first guess is that the strategy is not actually in a live position.

        Is your strategy green or yellow on the Strategies tab of the Control Center when this alert is generated?
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          yellow and in the positions tab it shows a position at the same time the alert is sent, I have a string show, but a string does not bring anything but text Correct?

          or can the string actually bring the position, average price etc

          Comment


            #6


            Comment


              #7
              DTSSTS,

              Generally a string will only display text, but in this case (String 0, String 1, String 2) these strings can be object values like you have selected.

              Since you are in a historical position (and not a live position)when the strategy starts it would be expected for Position.AveragePrice to be 0. I expect that when your strategy transitions to a live position you will see Position.AveragePrice print correctly.
              Josh G.NinjaTrader Customer Service

              Comment


                #8
                ok that is good to know. What we are hoping to do here is Have the currently developing strategy auto trade BUT we are planning to create a Alert Version that will not create Positions just Draw on the Chart - which in sim mode does plot the price on chart, but for a trader he will then have sim plots and actual trade plot on chart and be a real cluster on visual of chart was hoping to log price in sim mode
                May just have to Draw an Arrow on the trigger price, but i have not be able to figure that out

                Comment


                  #9
                  ok i got the drawings going, when creating a Alert Log message NOT the one with the order, they only show up in testing on real time data?

                  Comment


                    #10



                    this is the alert log code i came up with,

                    Comment


                      #11
                      DTSSTS,

                      That is correct. Alert() will not trigger until the script reaches State.RealTime

                      Josh G.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by NullPointStrategies, Yesterday, 05:17 AM
                      0 responses
                      58 views
                      0 likes
                      Last Post NullPointStrategies  
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      133 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      73 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      45 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      50 views
                      0 likes
                      Last Post TheRealMorford  
                      Working...
                      X