Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Turning losers into winners

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

    Turning losers into winners

    Dear Cservice,

    I'm still struggling with autotrail breakeven. I drew a picture in paint of my idea.

    I've noticed that many of my trades start as winners, but turn out as losers. I'm trying to turn that as much as possible.

    The picture explains 3 sorts of trades:
    A: pure Winners
    B: pure Losers
    C: Losers that start out as winners

    I would like the stoploss to move to breakeven when a trade reaches 100 points on the DAX future (0.5 tick). I tried this with the command:

    if (Close[0] > Position.AvgPrice + 200 * TickSize)
    {
    SetStopLoss(CalculationMode.Price, Position.AvgPrice);
    }
    But it did not work. What's wrong with this code?

    Second as the winner trade A reaches a certain point, not only do I want to move the stoploss to breakeven, I would like to save some of profit by raising the stoploss to the green line.

    How do I implement this?

    Thanks,
    Attached Files

    #2
    Hello Robert87,

    The FDXM (FDAX mini) has a tick size of 1 and a point value of 5.00.

    This means that every tick with the FDXM is 1 point. 1 tick = 1 point when the ticksize is 1.

    If you want to move after 100 points, use Position.AvgPrice + 100 * TickSize.

    Further, add prints to your code and use TraceOrders.

    Each time the condition is called, print the value of the close price and the value of your calculated trigger price.

    Print(string.Format("{0} | close: {1} > triggerprice: {2}", Time[0], Close[0], (Position.AvgPrice + 100 * TickSize)));

    Is the close price above your calculated trigger price?

    It is important that you use prints to understand the behavior of your code.
    https://www.youtube.com/watch?v=K8v_...tu.be&t=48m45s
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jpapa, Today, 07:22 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by kevinenergy, 02-17-2023, 12:42 PM
    116 responses
    2,757 views
    1 like
    Last Post kevinenergy  
    Started by franatas, 12-04-2023, 03:43 AM
    7 responses
    106 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Jltarrau, Today, 05:57 AM
    3 responses
    8 views
    0 likes
    Last Post Jltarrau  
    Started by f.saeidi, Today, 05:56 AM
    2 responses
    8 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X