MACD indicator - page 54

 

...

Still no idea what are you after but here is this version, maybe that is what you are looking for

Riksha:
I need a line on top of the MACD histogram as well as Osma , not found in settings, in version 1.2 in my opinion there is no line ,please tell me how to make a line,thanks in advance
 

This is what I wanted,many thanks

 

MACD RSI bars combined

Hello,

Is there, or does anyone know if a MACD/RSI signal bar combined exists, with alert.

So if MACD is above 0 and RSI is above 0 then green bar, if both below 0 then red bar. If undecided then orange or something.

Standard MACD and RSI settings, with an alert when colour change would be a real bonus.

Bit like this.

 

pgtips

Something is wrong in your description : RSI oscillates between 0 and 100 (it does not go under 0).

pgtips:
Hello,

Is there, or does anyone know if a MACD/RSI signal bar combined exists, with alert.

So if MACD is above 0 and RSI is above 0 then green bar, if both below 0 then red bar. If undecided then orange or something.

Standard MACD and RSI settings, with an alert when colour change would be a real bonus.

Bit like this.

 
mladen:
pgtips Something is wrong in your description : RSI oscillates between 0 and 100 (it does not go under 0).

ahhh, of course, you are absolutely right, I meant to say when RSI is above 50 and MACD is positive (above 0) then green, or if RSI is below 50 and MACD is below 0 then red, anything else orange or any other colour.

I feel like a fool becuase I know better :-)

PG

 

Macd & rsi

This would be it then

Have a nice weekend

pgtips:
ahhh, of course, you are absolutely right, I meant to say when RSI is above 50 and MACD is positive (above 0) then green, or if RSI is below 50 and MACD is below 0 then red, anything else orange or any other colour.

I feel like a fool becuase I know better :-)

PG
 

Macd crossover to alert only once

I HAVE MACD CROSSOVER ALERT AND I THINK IT ALERTS WHEN THEY KINDA CROSSOVER NOT NECESSARILY THE ZEROLINE BUT I NEED IT TO ALERT ONCE PER ARROW DISPLAYED COS IT KEEPS ON ALERTING ON CLOSE OF EVERY CANDLE FROM 1ST TO 4TH I THINK AND SECONDLY I WANT IT TO STATE ENTRY PRICE.

PLS ANYONE WITH THIS MODIFICATIONS SHOULD PLS SEND IT TO ME OR BEST OF ALL PLS MAKE THE MODIFICATIONS ON THE CODE BELOW

THANKS ALL U'RE SPECIAL

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

//| MACD Crossover Arrows & Alert |

//| Copyright © 2006 Written by PussyGalore |

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

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 DodgerBlue

#property indicator_width1 3

#property indicator_color2 Magenta

#property indicator_width2 3

extern int MACD_Fast = 20;

extern int MACD_Slow = 62;

extern int MACD_Slowing = 57;

extern int Bars_Count= 20000;

extern string note1 = "Arrow Type";

extern string note2 = "0=Thick, 1=Thin, 2=Hollow, 3=Round";

extern string note3 = "4=Fractal, 5=Diagonal Thin";

extern string note4 = "6=Diagonal Thick, 7=Diagonal Hollow";

extern string note5 = "8=Thumb, 9=Finger";

extern int ArrowType=2;

extern string note6 = "--------------------------------------------";

extern string note7 = "turn on Alert = true; turn off = false";

extern bool AlertOn = true;

extern string note8 = "--------------------------------------------";

extern string note9 = "send Email Alert = true; turn off = false";

extern bool SendAnEmail=false;

double CrossUp[];

double CrossDown[];

string AlertPrefix, MA1short_name, MA2short_name;

string GetTimeFrameStr() {

switch(Period())

{

case 1 : string TimeFrameStr="M1"; break;

case 5 : TimeFrameStr="M5"; break;

case 15 : TimeFrameStr="M15"; break;

case 30 : TimeFrameStr="M30"; break;

case 60 : TimeFrameStr="H1"; break;

case 240 : TimeFrameStr="H4"; break;

case 1440 : TimeFrameStr="D1"; break;

case 10080 : TimeFrameStr="W1"; break;

case 43200 : TimeFrameStr="MN1"; break;

default : TimeFrameStr=Period();

}

return (TimeFrameStr);

}

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

if (ArrowType == 0) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 233);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 234);

}

else if (ArrowType == 1) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 225);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 226);

}

else if (ArrowType == 2) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 241);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 242);

}

else if (ArrowType == 3) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 221);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 222);

}

else if (ArrowType == 4) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 217);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 218);

}

else if (ArrowType == 5) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 228);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 230);

}

else if (ArrowType == 6) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 236);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 238);

}

else if (ArrowType == 7) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 246);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 248);

}

else if (ArrowType == 8) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 67);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 68);

}

else if (ArrowType == 9) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 71);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 72);

}

SetIndexBuffer(0, CrossUp);

SetIndexBuffer(1, CrossDown);

AlertPrefix=Symbol()+" ("+GetTimeFrameStr()+"): ";

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

bool NewBar()

{

static datetime lastbar;

datetime curbar = Time[0];

if(lastbar!=curbar)

{

lastbar=curbar;

return (true);

}

else

{

return(false);

}

}

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

//| Custom indicator iteration function |

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

int start() {

int limit, i, counter;

double macdnow, macd_signow, macdprevious, macd_sigprevious, macdafter, macd_sigafter;

double Range, AvgRange;

int counted_bars=IndicatorCounted();

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++) {

counter=i;

Range=0;

AvgRange=0;

for (counter=i ;counter<=i+9;counter++)

{

AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);

}

Range=AvgRange/10;

macdnow = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i);

macdprevious = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i+1);

macdafter = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i-1);

macd_signow = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i);

macd_sigprevious = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i+1);

macd_sigafter = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i-1);

if ((macdnow > macd_signow) && (macdprevious macd_sigafter)) {

CrossUp = Low - Range*1.5;

if (AlertOn && NewBar()) {

Alert(AlertPrefix + "UPZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses UP");

}

if (SendAnEmail && NewBar()) {

SendMail(AlertPrefix, "UPZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses UP");

}

}

else if ((macdnow macd_sigprevious) && (macdafter < macd_sigafter)) {

CrossDown = High + Range*1.5;

if (AlertOn && NewBar()) {

Alert(AlertPrefix + "DOWNZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses DOWN");

}

if (SendAnEmail && NewBar()) {

SendMail(AlertPrefix, "DOWNZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses DOWN");

}

}

}

return(0);

}

 
oskay2012:
I HAVE MACD CROSSOVER ALERT AND I THINK IT ALERTS WHEN THEY KINDA CROSSOVER NOT NECESSARILY THE ZEROLINE BUT I NEED IT TO ALERT ONCE PER ARROW DISPLAYED COS IT KEEPS ON ALERTING ON CLOSE OF EVERY CANDLE FROM 1ST TO 4TH I THINK AND SECONDLY I WANT IT TO STATE ENTRY PRICE.

PLS ANYONE WITH THIS MODIFICATIONS SHOULD PLS SEND IT TO ME OR BEST OF ALL PLS MAKE THE MODIFICATIONS ON THE CODE BELOW

THANKS ALL U'RE SPECIAL

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

//| MACD Crossover Arrows & Alert |

//| Copyright © 2006 Written by PussyGalore |

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

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 DodgerBlue

#property indicator_width1 3

#property indicator_color2 Magenta

#property indicator_width2 3

extern int MACD_Fast = 20;

extern int MACD_Slow = 62;

extern int MACD_Slowing = 57;

extern int Bars_Count= 20000;

extern string note1 = "Arrow Type";

extern string note2 = "0=Thick, 1=Thin, 2=Hollow, 3=Round";

extern string note3 = "4=Fractal, 5=Diagonal Thin";

extern string note4 = "6=Diagonal Thick, 7=Diagonal Hollow";

extern string note5 = "8=Thumb, 9=Finger";

extern int ArrowType=2;

extern string note6 = "--------------------------------------------";

extern string note7 = "turn on Alert = true; turn off = false";

extern bool AlertOn = true;

extern string note8 = "--------------------------------------------";

extern string note9 = "send Email Alert = true; turn off = false";

extern bool SendAnEmail=false;

double CrossUp[];

double CrossDown[];

string AlertPrefix, MA1short_name, MA2short_name;

string GetTimeFrameStr() {

switch(Period())

{

case 1 : string TimeFrameStr="M1"; break;

case 5 : TimeFrameStr="M5"; break;

case 15 : TimeFrameStr="M15"; break;

case 30 : TimeFrameStr="M30"; break;

case 60 : TimeFrameStr="H1"; break;

case 240 : TimeFrameStr="H4"; break;

case 1440 : TimeFrameStr="D1"; break;

case 10080 : TimeFrameStr="W1"; break;

case 43200 : TimeFrameStr="MN1"; break;

default : TimeFrameStr=Period();

}

return (TimeFrameStr);

}

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

if (ArrowType == 0) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 233);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 234);

}

else if (ArrowType == 1) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 225);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 226);

}

else if (ArrowType == 2) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 241);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 242);

}

else if (ArrowType == 3) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 221);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 222);

}

else if (ArrowType == 4) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 217);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 218);

}

else if (ArrowType == 5) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 228);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 230);

}

else if (ArrowType == 6) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 236);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 238);

}

else if (ArrowType == 7) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 246);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 248);

}

else if (ArrowType == 8) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 67);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 68);

}

else if (ArrowType == 9) {

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0, 71);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1, 72);

}

SetIndexBuffer(0, CrossUp);

SetIndexBuffer(1, CrossDown);

AlertPrefix=Symbol()+" ("+GetTimeFrameStr()+"): ";

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

bool NewBar()

{

static datetime lastbar;

datetime curbar = Time[0];

if(lastbar!=curbar)

{

lastbar=curbar;

return (true);

}

else

{

return(false);

}

}

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

//| Custom indicator iteration function |

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

int start() {

int limit, i, counter;

double macdnow, macd_signow, macdprevious, macd_sigprevious, macdafter, macd_sigafter;

double Range, AvgRange;

int counted_bars=IndicatorCounted();

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(i = 0; i <= limit; i++) {

counter=i;

Range=0;

AvgRange=0;

for (counter=i ;counter<=i+9;counter++)

{

AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);

}

Range=AvgRange/10;

macdnow = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i);

macdprevious = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i+1);

macdafter = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_MAIN, i-1);

macd_signow = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i);

macd_sigprevious = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i+1);

macd_sigafter = iMACD(Symbol(), Period(), MACD_Fast, MACD_Slow, MACD_Slowing, PRICE_CLOSE, MODE_SIGNAL, i-1);

if ((macdnow > macd_signow) && (macdprevious macd_sigafter)) {

CrossUp = Low - Range*1.5;

if (AlertOn && NewBar()) {

Alert(AlertPrefix + "UPZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses UP");

}

if (SendAnEmail && NewBar()) {

SendMail(AlertPrefix, "UPZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses UP");

}

}

else if ((macdnow macd_sigprevious) && (macdafter < macd_sigafter)) {

CrossDown = High + Range*1.5;

if (AlertOn && NewBar()) {

Alert(AlertPrefix + "DOWNZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses DOWN");

}

if (SendAnEmail && NewBar()) {

SendMail(AlertPrefix, "DOWNZONE 4 MACD Bcos ("+MACD_Fast+","+MACD_Slow+","+MACD_Slowing+") crosses DOWN");

}

}

}

return(0);

}

Hi Oskay,

Made this one, it alerts like the code you posted but no repainting of the arrows and alerts once while the cross is happening(alertsOnCurrent=true) or after the cross has happened(alertsOnCurrent=false).

 

so kind, thank you, I will get to play with it tomorrow.

You have a great weekend too, i really appreciate this.

PG

mladen:
This would be it then
Have a nice weekend
 

Macd

Nice version of MACD
Files:
macd.gif  22 kb
Reason: