Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Aviram Y, Today, 05:29 AM
          4 responses
          11 views
          0 likes
          Last Post Aviram Y  
          Started by algospoke, 04-17-2024, 06:40 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by bmartz, 03-12-2024, 06:12 AM
          3 responses
          30 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by gentlebenthebear, Today, 01:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cls71, Today, 04:45 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X