Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple EMA Strategy Help...

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

    Simple EMA Strategy Help...

    Good Morning All,

    I'm interested in creating an EMA cross strategy, however, if possible, I'd like it to not be active during compression areas where it the market is tightly ranging. Any thoughts on what I can add as a condition?

    Thank you

    #2
    Hello ntbarone,

    Thank you for your note.

    You'd have to determine what exactly "tightly ranging" means to you in order to create a condition that would restrict trading during that. One thing to consider would be to look at the slope of the series. A slope between -0.5 and 0.5 would signify a fairly horizontal trend, a slope greater than 1 would indicate a fairly decent upward trend, and a slope below -1 would indicate a fairly downward trend. So you could try something like check if the slope is greater than 1 or less than -1 before entering - you could then make adjustments to those values to see what works best.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      This sounds exactly like what I'm looking for. Where would I find the slope settings? Thanks for your help and previous help in the past Kate.

      Nino

      Comment


        #4
        Hello ntbarone,

        Thank you for your reply.

        Slope can be found under the Misc folder and compared to a numeric value, also in Misc. You can choose the period of bars you like for the slope to be calculated over - the closer to 0 the slope is, the closer to a horizontal the trend is.

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Hi Kate

          so i couldnt get the slope solution to work, however, i used the adx to make the decision for me based on it being at 20 to make a trade however i dont want the trade to be made based on bar close, but instead on bar cross, which now isnt working. I was hoping you could assist me further. Essentually want to take trades when bar crosses the ema at an adx of 20. My other concern is the retracements back into the area where the ema is causing additional trades. Any thoughts? Sorry if im throwing a hodge podge at ya.

          Nino

          Comment


            #6
            Hello ntbarone,

            Thank you for your reply.

            You'd need to use either Calculate On Price Change or Calculate On Each Tick for it to be able to catch the cross intrabar.

            I've created a simple example script that enters long intrabar if the ADX is 20 greater and the price crosses the EMA. I've also added some logic to check that the position is flat and at least one bar has elapsed since the prior entry so it doesn't reenter on the same bar.

            Please let us know if we may be of further assistance to you.
            Attached Files

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            38 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            64 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X