Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

use the entry time object trade strategy SystemPerformance

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

    use the entry time object trade strategy SystemPerformance

    I have this

    if (
    SystemPerformance.AllTrades.Count > 0
    )
    {

    Trade oneTradeAgoData = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1];​


    oneTradeAgoPnL = ( oneTradeAgoData.EntryTime <= ToTime(HourFrom) || oneTradeAgoData.EntryTime >= ToTime(HourTo) ) ?
    0.0 : oneTradeAgoData.ProfitCurrency ;​
    }


    EntryTime thows this error

    NinjaScript File Error Code Line Column
    _TradesCounterCleaned.cs 'NinjaTrader.Cbi.Trade' does not contain a definition for 'EntryTime' and no extension method 'EntryTime' accepting a first argument of type 'NinjaTrader.Cbi.Trade' could be found (are you missing a using directive or an assembly reference?) CS1061 158 50
    Here I printed the Entry Time in a prior script:



    What is the simplest way to check for the Entry Time of trades for later use with SystemPerformance​?





    Last edited by PaulMohn; 09-13-2024, 09:59 AM.

    #2
    Hello PaulMohn,

    The print that you had seen in the other post is a formatted string that shows the values of the object and its sub properties, in code you need to use the execution to get the time.


    oneTradeAgoData.Entry.Time

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello PaulMohn,

      The print that you had seen in the other post is a formatted string that shows the values of the object and its sub properties, in code you need to use the execution to get the time.


      oneTradeAgoData.Entry.Time
      Thanks that worked:

      oneTradeAgoPnL = ( (oneTradeAgoData.Entry.Time <= HourFrom ) || ( oneTradeAgoData.Entry.Time >= HourTo ) ) ?
      0.0 : oneTradeAgoData.ProfitCurrency ;​

      Print(" ");
      Print("oneTradeAgoData.Entry.Time: " + oneTradeAgoData.Entry.Time);
      Print("ToTime(HourFrom): " + ToTime(HourFrom));
      Print("ToTime(HourFrom): " + HourFrom);​



      oneTradeAgoData.Entry.Time: 12/09/2024 18:00:00
      ToTime(HourFrom): 130000
      HourFrom: 13/09/2024 13:00:00​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      52 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      29 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      194 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      355 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      274 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X