Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATR Multiple

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

    ATR Multiple

    I am confused about one part of the code of my strategy.It is the Volatility Stop Loss. I am not sure if it is working correctly because in some exits it is working and in some others it seems is not because the loss is too big.

    I attach the part of the code of the stop loss and a picture of the graph so you can see.

    If you need the whole code let me know an email.

    Thanks

    Daniel
    Attached Files

    #2
    It looks like you have 2 exit orders per side...is that the way you intended it to be?

    Comment


      #3
      No, my intention is just one exit order per side (volatility stop) and the only possible way to exit apart from this was the exit on close.

      Which two exit orders do you refer?

      Thanks

      Daniel

      Comment


        #4
        What I mean is that with the volatility stop, the order should have been closed before it was with just a "little" loss, and not the way it was closed with about 4000 dollars.

        Thanks

        Comment


          #5
          Hello dvercher,
          The ExitLong() and ExitLongStop() are set at the same level. Please remove any one of them and see if you can get the correct entry.
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            What do you mean they are at the same level? Can you give me an example please?

            The part of the code is written now in a different way but I get the same problem. I attach the picture.

            Thanks
            Attached Files

            Comment


              #7
              Hello dvercher,
              You already have an ExitLongStop() order and you are further sending an ExitLong order. Both the order shares the same price (StopVolLong).

              I would suggest to use the below code in the Initialize section of the strategy and see if any orders are getting rejected or not.

              Code:
              TraceOrders = true;
              JoydeepNinjaTrader Customer Service

              Comment


                #8
                Hello,

                I tried to remove one of them but I get the same results. I add what you suggested to the initialize method but I don't have any data feed so I can't check it.

                By the way, at first sight do you think is there any kind of error in the code?

                Thanks

                Daniel

                Comment


                  #9
                  Hello dvercher,
                  To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

                  Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

                  I look forward to assisting you further.

                  *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
                  JoydeepNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by terofs, Yesterday, 04:18 PM
                  1 response
                  21 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by CommonWhale, Today, 09:55 AM
                  1 response
                  3 views
                  0 likes
                  Last Post NinjaTrader_Erick  
                  Started by Gerik, Today, 09:40 AM
                  2 responses
                  7 views
                  0 likes
                  Last Post Gerik
                  by Gerik
                   
                  Started by RookieTrader, Today, 09:37 AM
                  2 responses
                  12 views
                  0 likes
                  Last Post RookieTrader  
                  Started by alifarahani, Today, 09:40 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X