Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

daily risk

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

    daily risk

    Hi


    Ive been having some issues implementing daily risk stops, i programmed these a while back and some of the behaviour is not as expected, also if there was way to implement the solution in a more elegant manner becuase this seems to work on the backtests but not in live mode

    basically when the realized and open position together reaches -500euros i want it to flatten positions and actually terminate the strategy also i want it to constantly check this rather than just do it onbarupdate

    any help would be greatly appreciated

    thanks in advance

    Arilano


    if (priorTradesCumProfit - Performance.AllTrades.TradesPerformance.Currency.C umProfit > 500)
    return;
    elseif(priorTradesCumProfit - Performance.AllTrades.TradesPerformance.Currency.C umProfit < 500)
    {

    #2
    In 6.5, you can check in OnMarketData() however, this method is not called in backtest.

    Regarding not working in real-time, you would need to be more specific. I suggest debugging to see why you don't get expected behaviour. In case you have never seen it, here is a primer on debugging.

    RayNinjaTrader Customer Service

    Comment


      #3
      thanks ray i will check out those functions and the debugging piece

      Thanks
      Arilano

      Comment

      Latest Posts

      Collapse

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