• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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;
              http://www.ninjatrader.com/support/h...raceorders.htm
              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 brian meade, Today, 01:39 PM
                  1 response
                  4 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by Johnny Santiago, Today, 12:20 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by NinjaTrader_Brandon, Today, 10:24 AM
                  0 responses
                  47 views
                  0 likes
                  Last Post NinjaTrader_Brandon  
                  Started by ptertich, Today, 07:56 AM
                  2 responses
                  15 views
                  0 likes
                  Last Post Johnny Santiago  
                  Started by aslane, Today, 08:24 AM
                  1 response
                  14 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Working...
                  X