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 Max238, Today, 01:28 AM
        1 response
        22 views
        0 likes
        Last Post CactusMan  
        Started by giulyko00, Yesterday, 12:03 PM
        2 responses
        10 views
        0 likes
        Last Post giulyko00  
        Started by r68cervera, Today, 05:29 AM
        0 responses
        4 views
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        6 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        38 views
        0 likes
        Last Post JonesJoker  
        Working...
        X