• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 pparmley, Today, 04:30 PM
          0 responses
          6 views
          0 likes
          Last Post pparmley  
          Started by tonynt, Today, 04:21 PM
          0 responses
          4 views
          0 likes
          Last Post tonynt
          by tonynt
           
          Started by williamzz, Today, 03:44 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Miguel_88, Yesterday, 06:41 PM
          2 responses
          26 views
          0 likes
          Last Post Miguel_88  
          Started by williamzz, Today, 02:12 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Jim  
          Working...
          X