Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit/Loss two trades ago

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

    Profit/Loss two trades ago

    Good Morning,

    Question,

    If the script for Profit/loss of last trades is:
    SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1].ProfitCurrency;

    is the profit and loss for two trades ago:
    SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 2].ProfitCurrency;

    This does not seem to work when I try it.

    #2
    Hello TraderRod,

    Thanks for the post.

    Are you seeing an error or what specifically do you see happening when using that?

    I look forward to being of further assistance.

    Comment


      #3
      When I enter a -2 for two trades ago it returns the Profit and Loss of the last trade, not two trades ago.

      Comment


        #4
        Hello TraderRod,

        Just to clarify, you are saying that when you use - 2 you see the same information as the last trade in the collection or -1?

        The trades could potentially have the same value, are you seeing all other values of the trade object are the same?

        I tried the following print in the SampleMACrossOver and see this working.

        Code:
        if(SystemPerformance.AllTrades.Count < 2) return;
        Print(SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1].ProfitCurrency);
        Print(SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 2].ProfitCurrency);
        -12.5
        -262.5


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        160 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        308 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X