Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Long and Short in same strategy

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

    Long and Short in same strategy

    Can Ninjatrader go long and short now with the same strategy? I know in the past there have been issues with Forex.com, have those issues been remediated?

    If so, what versions of the platform have this fix?

    Thanks,

    -Omer

    #2
    Hi Omer, thanks for posting.

    A strategy can go long and short, just not at the same time. I would need you to provide a NTEIGHT tracking ID from the forum post you are looking at to find a specific issue and check if it was resolved. As of R26.1 you can place long and short orders using a Forex.com connection.

    Kind regards,
    -ChrisL

    Comment


      #3
      Hi Chris L,

      Here's the thread where it was discussed with NinjaTrader_Kate:

      Proper way to always be in the market (Long and Short) - NinjaTrader Support Forum

      "There is a known issue in which Forex.com connections may have issues reversing positions. We've added some code to help with this in NinjaTrader, but in order to diagnose if this may be the issue I would need to see an example of your logs from a time when this occurred."

      Comment


        #4
        Hi Omer, thanks for linking that. This is expected behavior from the connection, so we still must make code that will handle reversals in the Forex.com connection. The procedure will be:
        1. Set a bool "WaitingToClose" and call ExitLong/ExitShort with a special signal name when you want to reverse
        2. In OnExecutionUpdate, check for the execution.Order.Name that matches the unique name above and also check if "WaitingToClose" is true to see if the "close position" portion of the reversal has occurred. Then call EnterLong/EnterShort to enter in the opposite direction, and set WaitingToClose to false.
        This must be done so that the strategy waits to submit the reversing order.

        Kind regards,
        -ChrisL

        Comment


          #5
          Hi Chris,

          Do you have an example?

          This needs to be fixed as its basic functionality of the platform.

          Looks like a very complex workaround for a simple solution.

          -Omer

          Comment


            #6
            Hi Omer, I could not find an existing example so I made one to demonstrate how to reverse in the Forex.com connection. It's a bit contrived because it just flips back and forth, but it shows exactly how to perform the reversal.

            Kind regards.
            Attached Files

            Comment


              #7
              Thank you.

              Comment


                #8
                ömer mirza merhaba sana ulaşabileğim bir e posta adresi verebilirmisin bir stratejim var konu hakkında biraz yardımına ihtiyacım var

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                62 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                134 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                75 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                45 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                50 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X