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

How to let trade play out?

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

    How to let trade play out?

    Hi
    im making an auto trade but im having problems with trade switch from long to short when it match with short.

    Basically I want to let the trade play out. Sample, if I play ema cross on long side, I don't want not to switch if ema cross down and I want the long play to hit my target first it whatever I set my selling point to

    Thank you
    Last edited by SuperDude123; 09-23-2021, 02:06 PM.

    #2
    Hello SuperDude123,

    Thank you for your post.

    I would simply check that the position is flat before entering long or short if the other conditions would be true. This way, you can enter on a crossover, it won't enter if a cross in the opposite direction occurs unless you've already hit your prior stop or target and the position is flat. I'm attaching a very simple Strategy Builder strategy that demonstrates. You can unlock the code if you wish to look at the actual code that occurs or you can just leave it as locked and use it that way if you're currently using the Builder to create your logic.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      First off I want to say you guys are the best as far as helping out, quick respond. Thank you.

      So im advanced in coding but I can handle thing on strategies builder. If you can show me on strategies builder I would really appreciate.

      Comment


        #4
        Ohh I got it thank you

        Comment


          #5
          Hello SuperDude123,

          Thank you for your reply.

          The attached strategy above is made using the Strategy Builder as noted in my previous post and has not been unlocked so it may be viewed in a Strategy Builder window once imported through Tools > Import > NinjaScript Strategy. Simply open a new Strategy Builder window from New > Strategy Builder and select EMACrossEntryWithStopAndTargetExample on the first screen and you can step through the screens and click on the conditions to see what I've done.

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          6 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,235 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          7 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,415 views
          0 likes
          Last Post Traderontheroad  
          Working...
          X