Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fine-tuning my custom indicator

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

    Fine-tuning my custom indicator

    Hi,

    I created an indicators which sends me email alerts whenever the completed candle includes the value of a moving average, SMA(30). I typically use that on a 60 min charts.

    I recently ran into an issue where it would have been nice to get the alert 15 minutes prior the the 60 min bar completion.

    I can think of two solutions:

    1. CalculateOnBarClose = false, but in that case I need to tell the script to send me an email alert only once and hold on for a while, or else I will end up will hundreds of emails, one for every incoming tick where the 60 min candle includes the value of SMA(30). Which function/code allows me to do that?

    2. Use a multiple time frame approach where I would use the indicator with CalculateOnBarClose = true on a 15 minutes chart. But the indicator would check for the occurrence of 60_min_in_progress_candle = SMA(30). Can this be done?

    Thanks in advance.

    -MarcusPlexus

    #2
    marcusplexus, you can work with bool flag for your first question to just send the alert one time in realtime when your condition is 'true', of course you need to reset the bool then on the next bar to make the alert 'rearm'.

    The second approach can also be done, work with CalculateOnBarClose = false and monitor the first tick of your 15 min bar then to check for your conditions -

    Comment


      #3
      Ok. I have the information I need to fix my problem.

      Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, Yesterday, 09:41 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, Today, 02:41 AM
      0 responses
      6 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, Yesterday, 11:44 PM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      32 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      31 views
      0 likes
      Last Post CarlTrading  
      Working...
      X