Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order entry when price hits ema

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

    Order entry when price hits ema

    Hello,

    I've watched the 'Automate Your Trading Strategy' video and have looked through the help topics but have not been able to figure out how to, in the strategy builder, enter a position when the price hits an ema. I want a bar to close below an ema and then enter a long position when the price comes back up and touches the ema. If you can explain this to me or direct me to where to find the info that would be great.

    Thanks,
    mw355

    #2
    Hello mw355,

    You could use a bool variable for that purpose. Making a variable with a default value of false and then checking if the price crosses below the EMA would be how to set up this type of logic. If we assume the starting value is false and use a set to turn that to true based on the close crossing below the EMA that is half of the steps. In a second set you can check if the bool variable is true and also if the close is greater equal to the EMA. As long as the price is below the ema and the bool is true the order is not submitted, once the price crosses above it would be submitted. As you submit the order you would also need to set the bool variable to false to repeat the process.

    Comment


      #3
      Hello Jesse,

      Okay, thank you for the response.

      mw355

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      78 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X