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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X