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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      54 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Working...
      X