Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do i run a strategy in c# code

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

    How do i run a strategy in c# code

    Hi,

    I'd like to make a plot netProfit(x,y) by writing the result in a file.
    Is there a c# code like:
    s=strategy.run();
    result=s.netProfit();

    Thanks

    #2
    rGQRGs7,

    I am not sure what you mean exactly. Can you please clarify? If you meant writing to a file you can do so through this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3475
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_Josh,

      For the time being i use the optimizer and set the keep # best results to all(for example: x=1:10:1 y=1:10:1 -> best results=100). and then export to .csv.
      Then i can plot netprofit(x,y) with whatever software.
      I know how to write to a file, i just need a:
      foreach(result_ res in results)
      writeline(res)

      Thanks

      Comment


        #4
        rGQRGs7,

        What you can try to do is at the end of each optimization run, write a line. You could hard code in when a specific time/date is reached to write that line and just have that time/date being that of the last bar on the chart.

        You will have to build what you want to write manually though. There is no code line you can access to generate a prebuilt report "line".
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          NinjaTrader_Josh,

          Thank you very much

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          5 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          14 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Yesterday, 08:42 PM
          0 responses
          11 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Yesterday, 07:51 PM
          0 responses
          13 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,982 views
          3 likes
          Last Post jhudas88  
          Working...
          X