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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      144 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X