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

Best variable to access to find last order entry price?

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

    Best variable to access to find last order entry price?

    I am trying to find a way to set a boolean value to determine if my present price is above my last order's entry price.

    Here is my code (that doesn't work because entry.price is an object, not the actual price alone):

    Code:
     
    if (Performance.AllTrades.Count > 0)
    { Trade lastTrade2 = Performance.AllTrades[Performance.AllTrades.Count - 1 ];
    Print(lastTrade2.Entry.Price);
    if (lastTrade2.Entry.Price > GetCurrentAsk())
    allowentry = true;
    else
    allowentry = false;
    }
    else allowentry = true;
    When I look in my output window, this is the result:

    2/14/2008 12:40:00 PM 116.484375

    I want only the price, not the date or entire object variable. It looks ilke lastTrade2.Entry.Price is an object, not a double [notice the date too] of the price alone. Whats the best way to access this?

    [another variable?]

    #2
    oops. figured this out... the beta i'm using (post 6.508) preappends a date to all output data. that in fact is only price and convertable straight into double.

    all is ok.

    Comment


      #3
      Is this Beta 9? The time stamp is likely just a output window time stamp and not coming as part of the price.
      RayNinjaTrader Customer Service

      Comment


        #4
        Got it, Beta 9 we removed this time stamp again, it was a mistake.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by inanazsocial, Today, 01:15 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        6 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        1 view
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Working...
        X