Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy should go either short or long, but only trades short

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

    Strategy should go either short or long, but only trades short

    Hi,
    I have created the following entry logic. The variable "ONHigh" is above the market and the variable "ONLow2" is below the market. My problem is that the strategy now only trades short, although it should trade long when the market goes to "ONLow2". I can't figure out why it doesn't trade long and short, depending on where the market goes. The code seems correct, because, when I delete the short limit entry shown here, then it takes all the long trades. Am I missing some restrictions that might cause this phenomenon?
    Click image for larger version

Name:	image.png
Views:	234
Size:	34.4 KB
ID:	1282970

    #2
    Hello philmg,

    To make a bracket entry you would need to manually code the script using the unmanaged approach. The managed approach which the strategy builder uses will not allow you to do that type of order entry. There is a sample of what would be required to make a bracket entry here: https://ninjatrader.com/support/foru...926#post486926

    Comment


      #3
      Hi, I am not sure, if we are talking about the same thing. Do you consider a limit order above and another limit below the market as a bracket as well? I thought brackets are basically OCO orders, typically used for exiting with a stop or a limit and they cancel each other out. Here I really only want to place a limit order above and below, which don't need to cancel each other out.

      Comment


        #4
        Hello philmg,

        Yes that is considered a bracken entry even if it is not oco tied, the managed approach will ignore the second order. To submit two entry orders in opposite directions at the same time would require using the unmanaged approach.
        Methods that generate orders to enter a position will be ignored if:
        •The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
        https://ninjatrader.com/support/help...antedPositions

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X