Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 jaybedreamin, Today, 05:56 PM
                      0 responses
                      3 views
                      0 likes
                      Last Post jaybedreamin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      6 responses
                      18 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Jon17, Today, 04:33 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Jon17
                      by Jon17
                       
                      Started by Javierw.ok, Today, 04:12 PM
                      0 responses
                      6 views
                      0 likes
                      Last Post Javierw.ok  
                      Started by timmbbo, Today, 08:59 AM
                      2 responses
                      10 views
                      0 likes
                      Last Post bltdavid  
                      Working...
                      X