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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X