Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Angulation between 2 EMAs

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

    Angulation between 2 EMAs

    HI

    I have formula in my logic to calculate the difference between EMAs. My question is, Do i need two seprate emaAngulation8B for short and long? or Math.abs should do it just fine.
    For example if angulation short i enter short, if angulation is long i enter long
    double emaAngulation8B = Math.Abs(fastEMA[0] - slowEMA[0]);








    #2
    Hello tkaboris,

    Subtracting one ema from another would produce a positive or negative difference. Using Math.Abs will prevent the negative result making a non-negative value always. If that is what you are trying to do then that logic would accomplish that.

    If the purpose is to differentiate long vs short you may want to remove the Math.Abs here so you can get a positive or negative value. That would let you know a direction of difference for the purpose of choosing long or short.

    Your emaAngulation8B variable is going to be either the total difference discarding direction or a directional difference where you are considering the difference of the Fast plot in relation to the Slow plot.

    Comment


      #3
      Ok i just need angulation size.... However for some reason my longs are not working. i checked logic and cant figure out.

      I have
      EMAAngulation8B = 30;

      in my OnBarUpdate i have
      double emaAngulation8B = Math.Abs(fastEMA[0] - slowEMA[0]);

      and in my logic for Longs for bounce from 8 ema i have
      if (Trade8B

      && (Close[1] < Open[1] && High[1] > Open[1]) // previous bar bearish no wick
      && (Close[1] >= EMA(8)[1] && Close[0] > Open[0]) // Bar doesnt close below ema and current bar bullish
      && emaAngulation8B > EMAAngulation8B * TickSize
      )

      {

      entryOrder = SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Market, TradeSize, 0, 0, "", "8B");
      return;
      }

      Am I missing something?​

      Comment


        #4
        Hello tkaboris,

        I am not familiar with the term angulation size, if that is a math concept you can use google to locate the formula for that. Subtracting one value from another is commonly known as a difference. The abs or absolute value of a number would be its positive value representation, for example -1 is 1.

        The Math.Abs(fastEMA[0] - slowEMA[0]); could be read as the following when you get a positive or negative result:

        2000.25 - 2000.75 = 0.50
        2000.75 - 2000.25 = 0.50

        You otherwise need to use a Print here to see what the values are from your equation to better understand how that is effecting the condition.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        663 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        376 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X