Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trading with 2 conditions

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

    trading with 2 conditions

    I am working on a strategy with 2 conditions say red and green conditions.

    when condition green go long and cancel any short trade.

    when condition red go short and cancel any long trade.

    I thought I could do this with the Strategy builder with a Bool variable true and false, but I keep experiencing the long and short looping ? or going long continuously looping.

    sorry but obviously new to this??

    Many thanks in advance for any help

    #2
    Hello fredfred123,

    Thank you for your note.

    So I can better assist, you are saying you are getting back to back long trades?

    Could you provide more detail on what you mean by continuously looping?

    If you’d like to upload a copy of the strategy you’re running, I can take a look and see if anything jumps out.

    To export a NinjaScript from NinjaTrader 8 do the following:

    From the Control Center window select Tools -> Export -> NinjaScript...
    Click Add>Select the indicator>OK>Export.
    Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.

      I have been trying to export the NinjaScript but it keeps finding an error?

      what is happening is when the condition is green, I will experience multiple long entries and short entries continuously?

      The code seems to be looping without stopping, i just want one entry green to long the one entry red to short.

      The condition is red or green to go short or long ?

      I have set this up in the Strategy builder but I cannot have the right settings? The Strategy compiles ok.

      Comment


        #4
        I think I may have solved this with a combination of Bool conditions?


        set long then cancel long, go short, cancel short and then go long etc.

        seems to work so far ?

        Comment


          #5
          Hello fredfred123,

          What error are you receiving when you try to export?

          You could manually upload the strategy by finding the strategy in your My Documents>NinjaTrader 8 Folder>Bin>Custom>Strategies folder.

          I look forward to your reply.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 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
          70 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