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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 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
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X