Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print Command

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

    Print Command

    Hello,

    I have this script:

    Print(string.Format("Position: {0} | Precio > Prior: {1} | Precio > PP: {2}", Position.AvgPrice, Close[1]>PriorDayOHLC().PriorClose[0], Close[1]>Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).PP[0]));

    and whrn I go to the output windows, appears docens of tines with the same data:
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True
    Position: 0,7189 | Precio > Prior: True | Precio > PP: True

    How can I say to only appear one line?

    Thanks in advance.

    #2
    Hello josefo,

    Thanks for your post.

    You can control the printing to just once by using a bool. For example a bool named doitonce initialized to true:

    if (doitonce)
    {
    Print(string.Format("Position: {0} | Precio > Prior: {1} | Precio > PP: {2}", Position.AvgPrice, Close[1]>PriorDayOHLC().PriorClose[0], Close[1]>Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).PP[0]));

    doitonce = false; // set to false so we only print once.
    }

    Comment


      #3
      OK Thank you,

      And what is the sentence to print only the trades with a positive result? I mean with a PnL>0?

      Thanks in advance.

      Comment


        #4
        Hello josefo,

        Thanks for your reply.

        For all information regarding trades performance you will want to review TradeCollection here: http://ninjatrader.com/support/helpG...collection.htm

        For winning trades, under trade collection is: http://ninjatrader.com/support/helpG...ningtrades.htm

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X