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 05arminia, Today, 12:03 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by MakesTrades23, Yesterday, 10:39 PM
          1 response
          27 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by Emmarq25, Yesterday, 11:01 PM
          2 responses
          41 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Started by Johnny, Yesterday, 01:11 PM
          7 responses
          74 views
          1 like
          Last Post brucerobinson  
          Started by Chief2014, Yesterday, 01:03 PM
          1 response
          24 views
          0 likes
          Last Post NinjaTrader_Jason  
          Working...
          X