Announcement

Collapse
No announcement yet.

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

    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.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X