Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

marking time of losses

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

    marking time of losses

    I use this to mark the time of any stop loss.
    protected override void OnExecution(IExecution execution)
    {
    if (execution.Name == "Stop loss")
    {
    lastSLTime = ToTime(Time[0]);
    }
    }
    How can I mark exitLong and exitshort in case they lose money, only?
    Last edited by dafonseca; 05-13-2014, 08:41 PM.

    #2
    Hello dafonseca,

    You would do something similar to that but you would just have to check for the Exit Names that you give to your Exit Orders and then you may check your Position.AvgPrice to the current Market Price to see if it is a loss.

    An ExitLong() order will be named as a "Sell" by default. You may want to give your orders names to help identify your Orders so that you may check for them.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      I am getting the point...
      You mean the name we give when the order is generated, just like that below, dont you?
      EnterLong(0,positionTaken,"InRangeL7");

      Comment


        #4
        Hello dafonseca,

        Yes, that is correct and the same for your Exit orders.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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