Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Crossing of.

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

    Crossing of.

    In Strategy Builder I have set 2 variables of a high and a low. What I want is to enter as soon as bid or ask crosses this value with an offset. But I get an error message that left and right expressions do not match. Am using on every tick so I do not wait till the close of a bar.
    Thanks.
    Attached Files

    #2
    Hello Trader17,

    I would suggest changing your operator to >, greater than rather than cross above. CrossAbove when referenced from the Builder takes in two data series for its calculations, and GetCurrentBid is not a series.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      I will try that. I wanted to use the cross instead of > because with every tick that is greater than the high it might try to open multiple positions instead of cross that does not happen with every tick.

      Comment


        #4
        Hello Trader17,

        To avoid having the condition remain true after its crossed above, you could create a Variable in the builder with a default setting of false, include an if statement checking that this variable is false, and upon your condition block becoming true, set this variable to true so that this block will not run again.

        I put together screen shots for how this could be accomplished.

        Please let us know if you need further assistance.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Got it. I do like your idea but am not too good at coding yet. Does the Builder have something like Open Trades/Positions in it? That could be used too as a condition like if Open Position < or = or something similar to stop it from opening trades at every tick.
          Thanks.

          Comment


            #6
            Hello Trader17,

            Yes, within the Strategy folder of the condition builder, you can add a if statement, MarketPosition == MarketPosition.Flat.

            You could also set entries per direction and entry handling, to limit additional calls to EnterLong.

            Please see,



            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Thanks. That should work for me.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              54 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              130 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              71 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              44 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              49 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X