Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Express EMA is not present in current bar ?

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

    Express EMA is not present in current bar ?


    Is there a way to elegantly express that EMA is not present withing the current bars high and low?

    Close[0] > Open[0] && EMA(200)[0]

    #2
    I was using this approach but its on cross, and if my signal is currently on ema200 it still opens long. I just want to elimiate ema on current bar. Is there away to do it?
    && !(CrossAbove(Close, EMA(200)[0], 1))
    Last edited by tkaboris; 03-16-2023, 03:09 PM.

    Comment


      #3
      Hello tkaboris,

      Thank you for your post.

      If you want to check that the EMA is not present within the current high and low, you would want to check if the EMA is greater than the high or lower than the low. This would look like the following:

      Code:
      if (EMA(200)[0] > High[0] || EMA(200)[0] < Low[0])
      {
      // this print statement will print the time of the current bar, the EMA(200) for the current bar, and the high and low of the current bar so you may see and compare the values
      Print(String.Format("{0} EMA(200)[0]: {1} High[0]: {2} Low[0]: {3}", Time[0], EMA(200)[0], High[0], Low[0]));
      }
      Please let me know if I may be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      71 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      143 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      76 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      47 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      51 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X