stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

TMA alert, modification wanted
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5055
Page 1 of 1
Author:  thomasmore [ Tue Jan 24, 2017 2:22 pm ]
Post subject:  TMA alert, modification wanted

Dear all,
I use TMA-bands with an alert function, but I'd like the alert fired when the Price touches/pierces/crosses the outer band (as circled in the pic). My usual trial & error and copy/paste coding skills didn' t do the job this time, so any help would be appreciated.
Best regards,
Thomas
Author:  milanese [ Tue Jan 24, 2017 4:04 pm ]
Post subject:  TMA alert, modification wanted

thomasmore » Tue Jan 24, 2017 2:22 pm wrote:Dear all,
I use TMA-bands with an alert function, but I'd like the alert fired when the Price touches/pierces/crosses the outer band (as circled in the pic). My usual trial & error and copy/paste coding skills didn' t do the job this time, so any help would be appreciated.
Best regards,
Thomas
the attached one should do what you ask for...
TmaTrue with Distances_6xx.mq4
Cheers :)


Tommaso
Author:  thomasmore [ Tue Jan 24, 2017 5:32 pm ]
Post subject:  TMA alert, modification wanted

Thanks Tommaso for your prompt reply !
However, the indi I send calculates StdDev of the TMA, and the indi you send plots a multiplier of the ATR.
I "my" indi, I see some values that trigger the alert (upbuffer, downbuffer) so I think changing these would get the alert on the outer bands. Appreciate I you would have a look at it.
best regards,
Thomas
Author:  milanese [ Tue Jan 24, 2017 5:40 pm ]
Post subject:  TMA alert, modification wanted

thomasmore » Tue Jan 24, 2017 5:32 pm wrote:Thanks Tommaso for your prompt reply !
However, the indi I send calculates StdDev of the TMA, and the indi you send plots a multiplier of the ATR.
I "my" indi, I see some values that trigger the alert (upbuffer, downbuffer) so I think changing these would get the alert on the outer bands. Appreciate I you would have a look at it.
best regards,
Thomas
I know your version as I modified it.., but I have no idea what you want there changed.. sorry, as it alters as intended..
an other version that gives inverse signal I attach here.. As I do not understand yiour request it is again only a try..
Author:  heart1010 [ Wed Jan 25, 2017 8:48 am ]
Post subject:  TMA alert, modification wanted

@thomasmore
With your indicator you get the alert when reaching the dotted lines (and not the outer band/line), correct?

Try attached modified version which should alert you when outer bands are touched.

Only changed two lines (see commented out lines)

Code: Select all

      tmBuffer[i] = iCustom(NULL,timeFrame,IndicatorFileName,"calculateTma",HalfLength,Price,BandsDeviations,0,shift1);
      upBuffer[i] = iCustom(NULL,timeFrame,IndicatorFileName,"calculateTma",HalfLength,Price,BandsDeviations,1,shift1);
      dnBuffer[i] = iCustom(NULL,timeFrame,IndicatorFileName,"calculateTma",HalfLength,Price,BandsDeviations,2,shift1);

      level=(upBuffer[i]-dnBuffer[i])*20/100; // other lines take away 20% OF DIFFERENCE IN RANGE
      
      upLevel[i] = (upBuffer[i] - level);
      dnLevel[i] = (dnBuffer[i] + level);
       //if (Bid > upLevel[0] &&Bid < upLevel[1] &&tLastAlert<Time[0])
       if (Bid > upBuffer[0] && Bid < upBuffer[1] && tLastAlert<Time[0])
      {
      
     fireAlerts(" TMA Bands "+Symbol()+" upcross  ");
            tLastAlert=Time[0];
           
      
      }
       //if (Bid < dnLevel[0] &&Bid > dnLevel[1] &&tLastAlert<Time[0])
       if (Bid < dnBuffer[0] && Bid > dnBuffer[1] && tLastAlert<Time[0])
      {
      
     fireAlerts(" TMA Bands "+Symbol()+" downcross  ");
            tLastAlert=Time[0];
           
      
      }
Author:  heart1010 [ Wed Jan 25, 2017 8:51 am ]
Post subject:  TMA alert, modification wanted

...or you can test TMA+CG mladen.mq4 version (which should be nearly the same as yours with "correct" alerts). I also added arrows.
Author:  thomasmore [ Wed Jan 25, 2017 2:34 pm ]
Post subject:  TMA alert, modification wanted

heart1010 » 25 Jan 2017, 10:51 wrote:...or you can test TMA+CG mladen.mq4 version (which should be nearly the same as yours with "correct" alerts). I also added arrows.
That's exactely what I needed !
Thanks a lot,

Thomas
Author:  mraza [ Mon Aug 07, 2023 12:47 am ]
Post subject:  Re: TMA alert, modification wanted

Hi Thomas, would it be please possible to add push alerts for mobile to this indicator. will much appreciate. thanks in advance.

Regards

Malik
Author:  thomasmore [ Mon Aug 14, 2023 10:02 am ]
Post subject:  Re: TMA alert, modification wanted

mraza wrote: Mon Aug 07, 2023 12:47 am Hi Thomas, would it be please possible to add push alerts for mobile to this indicator. will much appreciate. thanks in advance.

Regards

Malik
Hi mraza, I found this indicator on another forum (long time ago), and since I am not a coder, Iasked for assistance here on SHF. So ,sorry, I can't be of any help to you.
Cheers,
thomasmore
All times are UTC Page 1 of 1