Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shouldn't Ninja ATMs work with Gain?

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

    Shouldn't Ninja ATMs work with Gain?

    CAUTION: Ranting ahead!

    I have been using Ninja in demo mode with MBT and have noticed how Ninja will frequently fail to reconnect with MBT after they do their midnight maintenance. This makes running a NinjaScript stategy or keeping an open position with an ATM running out of the question with MBT.
    So recently I opened a small Gain account to experience live trading with Ninja with a broker it has been working with for many years. I figured that now I will see how things are supposed to work. Well...
    Early this morning I had an open position in the EUR/USD. It was the very first live position I have ever traded on Ninja. I had opened it using chart trader and had a simple ATM running. Trading two lots, at my T1 the ATM would scale out one lot and move my stop to breakeven+1 for the remaining lot. Simple basic Ninja ATM stuff. No NinjaScript running, nothing fancy.
    The ATM worked sort of. When my T1 was hit the ATM fired off the order to close one lot and move my stop. But then the wheels came off. Apparently the Gain server didn't understand the order and rejected it. Now Ninja popped up a dialog telling me somthing like "the order could not be placed".
    So now what? Was Ninja waiting for my response? Would Ninja keep trying to place the order? Was the ATM still running? Why tell me there was an error message from the Gain server? Why not interpret the error message and deal with it programatically? Am I to believe that Gain sent an error message that Ninja has never seen before? Is there some reason Ninja cannot query the Gain server for my account positions so that it would know what to do? What if I had been away from the computer?
    Fortunately I was not away and I was able to manually close the position with a very nice profit which makes me very happy!
    The discovery that even the simple built in Ninja ATM strategies are unreliable makes me very unhappy!! Why am I wasting time developing and backtesting NinjaScript strategies when simple built in strategies don't work correctly?
    I wrongly assumed that Ninja would work perfectly with Gain after all these years of operation. Do Ninja strategies work correctly with any Forex broker? Any broker of any kind?
    Sorry for my disgusted tone but I am disgusted!
    I still love Ninja for manual trading but all my confidence about using the platform for autotrading is gone in this one trade. Speaking to another trader in my group this morning I learned that this kind of thing is apparently common. Unfortuantely for him he WAS away from his computer when Ninja failed to modify his orders. He lost his practice account in the process.

    Gains

    #2
    First, did you disable sub-pip support under Tools > Options > Misc.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      Yes, I have sub pips disabled. Is that the correct setting?

      Let me say that I have been using Ninja in Simulation with Gain data for quite some time and ATMs work fine in Sim mode. I am under the impression that the only setting that needs to be changed is the lot count, 1 instead of 10,000.
      Are there any other settings that need to be changed?

      Also let me clarify that the ATM did seem to work when my T1 was hit so the target was calculated correctly. That is when the error dialog popped up.

      Thanks,
      Gains

      Comment


        #4
        Please check your log tab, likely their was a problem with an order, invalid price at time order was submitted etc...
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          Please check your log tab, likely their was a problem with an order, invalid price at time order was submitted etc...
          The tab no longer shows what happened yesterday but I dug into the log files and found this error.

          Unable to modify order '62875168' : GAIN Error [0] "New order activity suspended" Affected Order: Sell 1 Stop @ 1.5491

          This was my point though. I was under the impression that Ninja could deal with exceptions like this. I thought it knew the "state" of my account, positions, etc and could do a status check to determine what happened.
          Is the problem that the Gain server errors are not issued with enough detail?
          I know from manual trading to never trust the DOM. Not just the Ninja DOM but anybody's trading front end. For example I was taught to always make sure I am flat by checking my account directly and to not trust a frontend because glitches happen and open orders mysteriously hang around some times.
          If the same caution holds true for ATMs then I will simply not leave the PC when I have a trade on. I'm afraid this makes multiday swingtrading in the 24 hour forex market very challenging!! ;-)

          Am I missing something? Please let me know, I hope that I am!

          Do you think that custom Ninja stategies can be written to deal more robustly with errors than the ATMs do? I have not looked into what kind of interogating we can do of the broker server through the API. Can you point me to a link?

          Thanks
          Gains

          Comment


            #6
            These are not errors, GAIN disabled trading for some reason...There is nothing that we can do.
            RayNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Ray View Post
              These are not errors, GAIN disabled trading for some reason...There is nothing that we can do.
              Ray,
              I understand your perspective but to say the least I am a bit surprised. You don't see this as an error, ok fine how about an exception? The Gain server did not respond as expected and Ninja crashed the ATM. To me this sure seems like an unhandled exception, which I perhaps incorrectly think of as a bug or an error or hole in the program logic. Are you saying Ninja cannot be made to handle this situation more elegantly?
              It's not like Gain did a Refco and shut its servers down permanently! We are talking seconds here.

              In this instance Ninja was unable to do anything but I WAS able to do something manually within seconds of receiving the error message. Gain did not reject my manual order attempt. It was a very simple process in fact and I was prepared to place the order repeatedly until it was accepted. Seems like a repetitive task perfectly suited to a bit of automation. The kind one might expect from an automated trade management system.
              The only error checking I then did was to make sure the positions in my account were as expected.

              I know this is all easy for me to say and perhaps hard to program but I really can't imagine that maintaining proper synchronization between the Ninja platform and a trading account is a more difficult task than the many difficult tasks you have already tackled while creating NinjaTrader. And I would think that protecting the users account would be a top priority for NinjaTrader so that we are successful and can keep trading!

              Sorry for being so obnoxious about this but in my ideal world (fantasy world I guess) the program would have simply done what I did. And being lighting fast it would have done it more quickly.

              Oh well.

              Comment


                #8
                Problem solved! After thinking this through while typing a letter to support after it happened again it occured to me what was happening and it WAS just a simple setting in the ATM Strategy set up dialog.

                My orders were going in as Day instead of GTC! At 1700 EST the stops and targets being Day orders are canceled and the position is left open with no protection! I just sat here and whatched my orders be canceled by Gain so this is confirmed.

                Ninja is unaware that the orders have expired and it still shows them on the chart. I can no longer change the orders of course and later when my target is hit Ninja will still try to move the expired stop to BE+1. Apparently when that fails the ATM simply stops and does not try to liquidate the T1 part of the position though it could if it tried I suppose.

                So beware! Make sure your orders go in as GTC if there is any chance you will have a multiday position!

                Obviously this is my user error but I am surprised that noone has ever encountered this before especially since it seems that the ATM defaults back to Day everytime you open a new chart. This is a disaster waiting to happen, especially since you do not need to ever look at the ATM setup dialog again once you set it up the first time. That is part of its power! You can quickly select a pre-made ATM and place an order but apparently you must also open the setup every time and change order type to GTC. So take care!!

                I found references to Day/GTC issue regarding NinjaScrpt strategies but not the ATM.
                I would request that NinjaTrader be changed so that orders would default to GTC instead of Day. People placing an order to open a position who want it only to be a day order would have this in mind and would logically pay attention to the Day/GTC setting whereas others who are placing an order that will fill very quickly or immediately are less likely to pay any attention to the setting. That was my mistake. Add to this the fact that once you have set it and think it is permanent it is not!

                Gains

                Comment


                  #9
                  A friend of mine who only uses the DOM just brought something to my attention.
                  So let me make this clear, the problems I am having are with ChartTrader and not the DOM.
                  The DOM seems to "remember" your GTC setting once you save your strategy. What I think is happening is each instance of chart trader will remember it as long as that chart is not closed. The same is true for the DOM I guess, it forgets once it is closed too but using the DOM you usually only have one or two of them open so this is less of an issue compared to having say 18 charts open and 18 different ATMs you need to remember to reset.

                  Also the DOM shows the TIF right there in your face so you can't miss it and it is just a click to set. The chart trader has the TIF hidden in the strategy set up so you have to open it to make sure it is set correctly.

                  Hope that makes sense!

                  Gains

                  Comment


                    #10
                    Thanks for your suggestion. We'll add it to the list of future considerations.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by arvidvanstaey, Today, 02:19 PM
                    2 responses
                    7 views
                    0 likes
                    Last Post arvidvanstaey  
                    Started by jordanq2, Today, 03:10 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post jordanq2  
                    Started by traderqz, Today, 12:06 AM
                    10 responses
                    18 views
                    0 likes
                    Last Post traderqz  
                    Started by algospoke, 04-17-2024, 06:40 PM
                    5 responses
                    46 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by mmckinnm, Today, 01:34 PM
                    3 responses
                    6 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X