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

First Trade Flat

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

    First Trade Flat

    Hey everyone, I am having a bit of an issue with one of my strategies. I have one that uses price change as one of the indicators, ie. close of current bar is higher than close of previous bar. Then it takes a buy, opposite for sell. I have it start at 9am and trades until noon. My problem is, if the condition is true at 9am it takes a buy/sell, and then could go right against me. I would like to be able to have it wait for a new signal instead. Ie. if close of current bar is higher than close of previous bar, it "would" normally buy but I want it to wait until the opposite signal fires. Is there a way to do this via strat builder? I have tried a few different things to no avail.

    Thanks in advance.

    #2
    Excuse me, but this is not a viable trading plan. I mean, technically of course you can set your strategy like that, but simple logic says that you cannot buy just because a bar closes higher than the previous. Prices fluctuate up and down all the time. You need to enter some more criteria in your strategy, because (as you write) a position opened this way “…then could go right against me” very easily and quickly.
    That’s why strategy builder allows for many conditions to be set in a strategy.

    Comment


      #3
      Hello sprks7979,

      To confirm, you are wanting a sequence of conditions to evaluate as true in a specific order?

      This is possible to create with the Strategy Builder using bools. When the first condition is true, set the bool to true. In the second condition require the bool to be true, trigger the action and set the bool back to false.

      Below is a link to an example.
      Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        @KonstantinosNT​ - yes, I understand that is not a usable plan. I did say "uses price change as ONE of the indicators" I made the example easy for simplicity sakes.


        @NinjaTrader_ChelseaB - Thank you, I am using a bool to do this, my issue is that if the "trigger" happens at 8:58 and at 9:00 it is still true, then it takes a trade. I am wanting it to wait until the next valid trade before entering. Would this need to be done using multiple condition tabs? This is a rough idea of what I currently have.

        Tab one - if X is true
        and Y is True
        and bool is set to True
        then buy and set bool to False

        Tab Two - if X is true
        and Y is True
        and bool is set to False
        then buy and set bool to True


        My other issue is that as it is written, as soon as the strategy opens it IMMEDIATELY takes a buy position no matter if true or false.

        In summary, I am looking for a way to delay the first entry until the next valid signal and be able to take entries in either direction.

        Thanks for your time.​​

        Comment


          #5
          Hello sprks7979,

          my issue is that if the "trigger" happens at 8:58 and at 9:00 it is still true, then it takes a trade. I am wanting it to wait until the next valid trade before entering.
          What is the condition set that submits the order?
          If the conditions to enter a trade with an entry order evaluate as true, and the bool is true, how is that not a valid signal? What makes it invalid?
          Are you requiring the bool variable to be true in the condition that submits the entry order?
          Are you wanting two valid entry signals? (You can use two bools if you need two valid entry signals to occur)

          Would this need to be done using multiple condition tabs?
          Yes, this has to be separate condition sets as demonstrated in the example provided.

          My other issue is that as it is written, as soon as the strategy opens it IMMEDIATELY takes a buy position no matter if true or false.
          What condition is evaluating as true to submit the order?
          Have you used prints to understand the behavior?
          https://ninjatrader.com/support/foru...121#post791121
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          938 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          2 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by rocketman7, Today, 01:00 AM
          0 responses
          1 view
          0 likes
          Last Post rocketman7  
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          27 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Working...
          X