Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to Load ATM Strategy Template using AtmStrategyCreate

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

    Unable to Load ATM Strategy Template using AtmStrategyCreate

    Hi

    My NinjaScript Strategy code places a market order and sends its trade-management control to a previously defined "SystemATM". For this, the function used is AtmStrategyCreate().

    However, on execution, although the order is placed successfully, but an error occurs indicating that it is unable to ATM template, as shown in the attachment. But, the template already exists at desired location.

    Important point is, before calling the AtmStrategyCreate() function, the NinjaScript code modifies contents of the ATM template on-the-fly using WriteAllLines(). Just to ensure that file is successfully written, the code ensures that the over-written ATM template opens successfully.

    May someone point out how can I successfully access the ATM template, from within the code?

    Thanks in Advance
    Vivek
    Attached Files

    #2
    Just a small clarification regarding:

    Originally posted by engrvivs View Post
    However, on execution, although the order is placed successfully, but an error occurs indicating that it is unable to ATM template, as shown in the attachment. But, the template already exists at desired location.
    "Order is placed successfully": Strangely, the AtmStrategyCreate() is able to set Stop-Loss, Target and Quantity, for the placed order, from the over-written SystemATM.

    Thus, I think the error that is being reported is related to trade control not being sent to SystemATM.
    Any ways to resolve, if this is the issue?

    Kind Regards
    Vivek

    Comment


      #3
      Hello,

      Thank you for the question.

      I am unsure of the code being used, but for ATM strategies in NinjaScript specifically there is only one example/pattern that would be suggested to be used. That would be the SampleAtmStrategy that comes with the platform. ATM/NinjaScript strategies specifically are very particular on the logic/syntax used for it to work correctly.

      I would not be sure on the result with you manually changing the ATM file. Changing the file while in use would cause issues with read/write, also it could be that the file was not written correctly based on the error. I could not really advise on that subject unfortunately as writing an ATM strategy to file in this way would not be documented.

      The only thing I could really suggest here would be to verify the logic works without modifying the ATM strategy as you are. Then to ensure you do not get errors while running the script. After that you could try writing to the ATM template, but I could not say what would be correct there. Likely this would be something you need to test and complete a series of trial and error steps to debug the problem.


      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Thanks Jesse for response!

        I will conduct prescibed tests without modifying ATM template file and observe the source of error.
        By the way, I also feel it is due to improper over-writing of ATM template, as in my case different instances of the same NinjaScript code (say, when applied to different Instruments) try to vary the same ATM file with different values. This may be source of issue.

        Nevertheless, if I drop the idea of modifying ATM template file, will AtmStrategyChangeEntryOrder() change Stop-Loss and Target to desired price levels, for the order that is placed using AtmStrategyCreate()?

        If so, will those changes be viewable on chart or DOM, etc.?

        Kind Regards
        Vivek

        Comment


          #5
          Hello,

          Thank you for the reply.

          Are you asking if the unfilled entry, when modified, if the stops would be updated as well to reflect the new entry price?

          If so, yes the stops would only be submitted after the entry is filled and would be managed based on the entry price.

          In general If you are looking to control stop and target prices, often it is easier to create a standard strategy that does not use ATM strategies as this would give you full control over all of the orders and targets.

          For a full list of available methods that can be used with ATM strategies from NinjaScript, please see this document: http://ninjatrader.com/support/helpG...gy_methods.htm


          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Actually, my question is for a filled order, placed using AtmStrategyCreate(). Can its stop-loss be changed using AtmStrategyChangeEntryOrder()?

            Thanks
            Regards
            Vivek

            Comment


              #7
              Hello,

              In this case, no.

              The method you have listed states that is is to change the Entry order per its name, to change a Stop or Target which would not be the entry, you would need to use AtmStrategyChangeStopTarget. http://ninjatrader.com/support/helpG...stoptarget.htm

              All the available methods you can use with descriptions are available in the helpguide here: http://ninjatrader.com/support/helpG...gy_methods.htm

              Please let me know if I may be of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cls71, Today, 04:45 AM
              0 responses
              1 view
              0 likes
              Last Post cls71
              by cls71
               
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              213 views
              1 like
              Last Post PaulMohn  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              4 responses
              544 views
              0 likes
              Last Post PaulMohn  
              Started by GLFX005, Today, 03:23 AM
              0 responses
              3 views
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              12 views
              0 likes
              Last Post XXtrader  
              Working...
              X