Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Non-programmer needs help

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

    Non-programmer needs help

    Hi, I am trying to create a Ninjascript using the strategy wizard, but I'm having a few problems completing it. I attached the exported file to this post.

    I want to place a long and a short order, at a certain time and a certain date, which would vary, and need to be changed whenever the ninjascript is used. Each order would be a stop limit order offset from the current price by about 10 ticks, and would cancel the other order if it was executed. If executed it would then implement a selected ATM strategy which would work in real time only, as stated in the help file.

    If neither order was executed it i would like to cancel both after a certain time. The ATM strategy would take care of the trade from there. I have attempted to set up a basic version of the ATM strategy using Stop and Profit Targets in the Ninjascript. When I tried to back test it, I got an error message saying that ninjatrader needs to shut down, although it didnt shut down. Can you tell me what is wrong with the script? The wizard said that it completed successfully.


    Is it possible to have user input as part of a Ninjascript, by using an input box? E.g. To set the time and date.

    As a more advanced version I would like to have user input of a number to trigger the trades being set after the time is reached. Would this be possible?

    Thanks,
    Matthew
    Attached Files

    #2
    Hi Matthew,

    You are not allowed to submit two entry orders at the same time. This violates are order handling rules for a strategy. You will have to remove one of these orders and try again.
    RayNinjaTrader Customer Service

    Comment


      #3
      To trade on both sides of the market I've split my strategy into long and short parts, executed independently, If you also wanna submit a pair of orders from each as OCO you'll need a global C# class keeping track of your orders.

      Comment


        #4
        Thanks for the replies. Does this mean I can't submit 2 orders at the same time, even if they'e OCO, or can they be submitted at slightly different times? E.g. 30 secs apart. I have run this strategy in MetaTrader no problem, so I thought I would be able to do it with NinjaTrader as well. Billitin, could you explain in more detail how this works? How do I get a global C# class to manage the orders?

        Comment


          #5
          You'll need to create a class in namespace NinjaTrader.Strategy (use any strategy template file for that) and initialize it only once per all run strategies, so that you can pass all your orders through it to modify them as needed and when necessary. From my experience it's not such an easy coding task for a beginner or someone who wants to learn the language... In the ideal world I'd rather find a way to execute my trades differently as I'm currently climbing the same wall
          Last edited by billitin; 07-11-2008, 11:38 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          650 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          577 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X