Coding help - page 775

warrior137
144
warrior137  

Hallo,

I would be very grateful if someone could help me

i need this indicator changed to MTF indicator

and add alert messages, arrow and sound the first time color change


(sorry for my english)

thank you very much


thank you

Keith Watford
Moderator
15740
Keith Watford  
warrior137:

Do not double post.

Your other post has been removed.

TienGrT
57
TienGrT  

Kindly help me this issue.

Below is MA cross alert, but I got too many messages per 1 same notification.

I just wanna get 1 notification per 2 consecutive bars, it means number of bars is 2 to skip before next alert.

How can I do, kindly help me. Thank you so much



//+------------------------------------------------------------------+

//|                MA Cross Arrows.mq4                               |

//|                Copyright © 2006  Scorpion@fxfisherman.com        |

//+------------------------------------------------------------------+

#property copyright "FxFisherman.com"

#property link      "http://www.fxfisherman.com"



#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Blue

#property indicator_color2 White

#property indicator_color3 Red



extern int Crossed_Pips = 0;

extern int MA_Period = 21;

extern int MA_Type = MODE_SMA;

extern int Shift_Bars=0;

extern int Bars_Count= 1000;

int state;

  

//---- buffers

double v1[];

double v2[];

double v3[];

  





int start()

 {

  double ma;

  int previous;

  int i;

  int shift;

  bool crossed_up, crossed_down;

  int totalBars = Bars - (MA_Period * 2);

  

  if (Bars_Count > 0 && Bars_Count <= totalBars)

  {

    i = Bars_Count;

  }else if(totalBars <= 0 ) {

    return(0);

  }else{

    i = totalBars;

  }

  

  while(i>=0)

   {

    shift = i + Shift_Bars;

    ma = iMA(Symbol(), Period(), MA_Period, 0, MA_Type, PRICE_CLOSE, shift);

    crossed_up = High[shift] >= (ma + (Crossed_Pips * Point));

    crossed_down = Low[shift] <= (ma - (Crossed_Pips * Point));



    v1[i] = NULL;

    v2[i] = NULL;    

    v3[i] = ma;

    if (crossed_up && previous != 1) {

      v1[i] = ma + (Crossed_Pips * Point);

      previous = 1;

    }else if(crossed_down && previous != 2){

      v2[i] = ma - (Crossed_Pips * Point);

      previous = 2;

    }

 

    i--;

   }

   

   ma = iMA(Symbol(), Period(), MA_Period, 0, MA_Type, PRICE_CLOSE, 0);

   if (Close[0] >= ma + (Crossed_Pips * Point) && state != 1) { 

      state = 1;

      SendNotification(Symbol() + "M"+_Period + " Price crossed UP EMA21.");

   }else if (Close[0] <= ma - (Crossed_Pips * Point) && state != -1) {

      state = -1;

      SendNotification(Symbol() + "M"+_Period + " Price cross DOWN the EMA21.");

   }



   return(0);

 }
Elgatoazul
106
Elgatoazul  

When I declare a extern variable I get an error message "extern-unexpected token"

Please help

Files:
error1.zip 116 kb
Farrukh Aleem
2109
Farrukh Aleem  
Ricardo Schuller:

When I declare a extern variable I get an error message "extern-unexpected token"

Please help

you cannot use extern inside a method or function.

Mo3tasemovic
28
Mo3tasemovic  

how to fix error ??

Keith Watford
Moderator
15740
Keith Watford  
Mo3tasemovic:

how to fix error ??

"GBPUSD"

Mo3tasemovic
28
Mo3tasemovic  
Keith Watford:

"GBPUSD"

thanks

beto_gauer
78
beto_gauer  
pivboll:

Help need to modify an indicator

I am trying to modify a MACD indicator to turn it into a Trend Thrust Indicator as described in Buff Dormeier book Investing with volume analysis.

I have issues with the variable and can not achieve a decent result. I am attaching the volWMA and the VW MACD that are working

Here is the description

Trend thrust indicator

The trend thrust indicator (Tti), an enhanced version of the volume-weighted moving average convergence/divergence (VW-Macd) indicator, was introduced in my book Investing With Volume Analysis. The Tti uses a volume multiplier in unique ways to exaggerate the impact of volume on volume-weighted moving averages. Like the VW-Macd, the Tti uses volume-weighted moving averages as opposed to exponential moving averages. Volume-weighted averages weigh closing prices proportionally to the volume traded during each time period, so the Tti gives greater emphasis to those price trends with greater volume and less emphasis to time periods with lighter volume. In the February 2001 issue of Stocks & Commodities, I showed that volume-weighted moving averages (Buff averages, or Vwmas) improve responsiveness while increasing reliability of simple moving averages.

Like the Macd and VW-Macd, the Tti calculates a spread by subtracting the short (fast) average from the long (slow) average. This spread combined with a volume multiplier creates the Buff spread

The calculation are the following

volume multiplier = fast VolWMA / slow VolWMA

the volume multiplier is taken to the second power and then multiplied by the fast VolWMA to give Volume enhance fast average

the volume multiplier is taken to the second power and then multiplied by the SLOW VolWMA to give Volume enhance slow average

TTi = enhance fast average - enhance slow average

Thank for your help

 

indicator link: https://www.sendspace.com/file/rfy2dv 

Hello my friend. Have you ever got the TTI sorted out? Can you share here or send me via PM? Thanks

Manfromqazvin
7
Manfromqazvin  
Hi
Could you plz help me with this problem
I need an EA which send push notification whenever the price bid diffrence from kinjun sen (in ichimoku) is bigger than 3 pips (30 points) in 1 minute time fream