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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X