How to code? - page 216

 

Sorry, I forgot to change the subject line.

It should be 'Get original S/L from modified order'.

Thanks,

Chris

 

Coder Combo filter please

hi all,

Any can coder the indicator for mq4, this is combo bar color filter multi pairs please.

EURUSD,"EUR/USD"

EURUSD,GBPUSD,AUDUSD,NZDUSD,~USDJPY,~USDCHF,~USDCAD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPUSD,"GBP/USD"

EURUSD,GBPUSD,AUDUSD,NZDUSD,~USDJPY,~USDCHF,~USDCAD,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

AUDUSD,"AUD/USD"

EURUSD,GBPUSD,AUDUSD,NZDUSD,~USDJPY,~USDCHF,~USDCAD,~EURAUD,~GBPAUD,AUDJPY,AUDNZD,AUDCHF,AUDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

NZDUSD,"NZD/USD"

EURUSD,GBPUSD,AUDUSD,NZDUSD,~USDJPY,~USDCHF,~USDCAD,~EURNZD,~GBPNZD,NZDJPY,~AUDNZD,NZDCHF,NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

USDJPY,"USD/JPY"

~EURUSD,~GBPUSD,~AUDUSD,~NZDUSD,USDJPY,USDCHF,USDCAD,EURJPY,GBPJPY,CHFJPY,CADJPY,AUDJPY,NZDJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

USDCHF,"USD/CHF"

~EURUSD,~GBPUSD,~AUDUSD,~NZDUSD,USDJPY,USDCHF,USDCAD,EURCHF,GBPCHF,~CHFJPY,CADCHF,AUDCHF,NZDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

USDCAD,"USD/CAD"

~EURUSD,~GBPUSD,~AUDUSD,~NZDUSD,USDJPY,USDCHF,USDCAD,EURCAD,GBPCAD,~CADJPY,~CADCHF,AUDCAD,NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURJPY,"EUR/JPY"

EURUSD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,USDJPY,GBPJPY,AUDJPY,NZDJPY,CADJPY,CHFJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURNZD,"EUR/NZD"

EURUSD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,~NZDUSD,GBPNZD,AUDNZD,~NZDJPY,~NZDCHF,~NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPJPY,"GBP/JPY"

GBPUSD,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD,USDJPY,EURJPY,AUDJPY,NZDJPY,CADJPY,CHFJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPNZD,"GBP/NZD"

GBPUSD,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD,~NZDUSD,EURNZD,AUDNZD,~NZDJPY,~NZDCHF,~NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

CADJPY,"CAD/JPY"

~USDCAD,~EURCAD,~GBPCAD,~AUDCAD,~NZDCAD,CADCHF,USDJPY,EURJPY,GBPJPY,AUDJPY,NZDJPY,CADJPY,CHFJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

AUDJPY,"AUD/JPY"

AUDUSD,~EURAUD,~GBPAUD,AUDNZD,AUDCHF,AUDCAD,USDJPY,EURJPY,GBPJPY,AUDJPY,NZDJPY,CADJPY,CHFJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

NZDJPY,"NZD/JPY"

NZDUSD,~EURNZD,~GBPNZD,~AUDNZD,NZDCHF,NZDCAD,USDJPY,EURJPY,GBPJPY,AUDJPY,NZDJPY,CADJPY,CHFJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURGBP,"EUR/GBP"

EURUSD,~GBPUSD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,~GBPAUD,~GBPNZD,~GBPJPY,~GBPCHF,~GBPCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURAUD,"EUR/AUD"

EURUSD,~AUDUSD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,GBPAUD,~AUDJPY,~AUDNZD,~AUDCHF,~AUDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURCHF,"EUR/CHF"

EURUSD,USDCHF,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,GBPCHF,~CHFJPY,CADCHF,AUDCHF,NZDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

EURCAD,"EUR/CAD"

EURUSD,USDCAD,EURGBP,EURAUD,EURNZD,EURJPY,EURCHF,EURCAD,GBPCAD,~CADJPY,~CADCHF,AUDCAD,NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPAUD,"GBP/AUD"

GBPUSD,~AUDUSD,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD,EURAUD,~AUDJPY,~AUDNZD,~AUDCHF,~AUDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPCHF,"GBP/CHF"

GBPUSD,USDCHF,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD,EURCHF,~CHFJPY,CADCHF,AUDCHF,NZDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

GBPCAD,"GBP/CAD"

GBPUSD,USDCAD,~EURGBP,GBPAUD,GBPNZD,GBPJPY,GBPCHF,GBPCAD,EURCAD,~CADJPY,~CADCHF,AUDCAD,NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

CHFJPY,"CHF/JPY"

~USDCHF,USDJPY,~EURCHF,~GBPCHF,~CADCHF,~AUDCHF,~NZDCHF,EURJPY,GBPJPY,CHFJPY,CADJPY,AUDJPY,NZDJPY

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

CADCHF,"CAD/CHF"

~USDCAD,USDCHF,~EURCAD,~GBPCAD,~AUDCAD,~NZDCAD,CADJPY,EURCHF,GBPCHF,~CHFJPY,CADCHF,AUDCHF,NZDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

AUDNZD,"AUD/NZD"

AUDUSD,~NZDUSD,~EURAUD,~GBPAUD,AUDNZD,AUDCHF,AUDCAD,AUDJPY,EURNZD,GBPNZD,~NZDJPY,~NZDCHF,~NZDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

AUDCHF,"AUD/CHF"

AUDUSD,USDCHF,~EURAUD,~GBPAUD,AUDNZD,AUDCHF,AUDCAD,AUDJPY,EURCHF,GBPCHF,~CHFJPY,CADCHF,NZDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

AUDCAD,"AUD/CAD"

AUDUSD,USDCAD,~EURAUD,~GBPAUD,AUDNZD,AUDCHF,AUDCAD,AUDJPY,EURCAD,GBPCAD,~CADJPY,NZDCAD,~CADCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

NZDCAD,"NZD/CAD"

NZDUSD,USDCAD,~EURNZD,~GBPNZD,NZDJPY,~AUDNZD,NZDCHF,NZDCAD,EURCAD,GBPCAD,~CADJPY,~CADCHF,AUDCAD

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

NZDCHF,"NZD/CHF"

NZDUSD,USDCHF,~EURNZD,~GBPNZD,NZDJPY,~AUDNZD,NZDCHF,NZDCAD,EURCHF,GBPCHF,~CHFJPY,CADCHF,AUDCHF

,,,,,,,,,,,,

0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769,0.0769

*USD,"USD"

~EURUSD,~GBPUSD,USDCHF,USDJPY,USDCAD,~AUDUSD,~NZDUSD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*EUR,"EUR"

EURUSD,EURGBP,EURCHF,EURJPY,EURCAD,EURAUD,EURNZD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*GBP,"GBP"

GBPUSD,~EURGBP,GBPCHF,GBPJPY,GBPCAD,GBPAUD,GBPNZD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*CHF,"CHF"

~USDCHF,~EURCHF,~GBPCHF,CHFJPY,~CADCHF,~AUDCHF,~NZDCHF

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*CAD,"CAD"

~USDCAD,~EURCAD,~GBPCAD,CADJPY,CADCHF,~AUDCAD,~NZDCAD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*JPY,"JPY"

~USDJPY,~EURJPY,~GBPJPY,~CHFJPY,~CADJPY,~AUDJPY,~NZDJPY

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*AUD,"AUD"

AUDUSD,~EURAUD,~GBPAUD,AUDJPY,AUDCAD,AUDCHF,AUDNZD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

*NZD,"NZD"

NZDUSD,~EURNZD,~GBPNZD,NZDJPY,~AUDNZD,NZDCHF,NZDCAD

,,,,,,

.175,.175,.175,.175,.1,.1,.1

 

PlaySound and Alert

Hello, is there any way to the PlaySound function and alert to run only once (indicator )?... Or you can just use ea Sleep (500)

Thanks

 

Profit Target and Stop loss indicator or EA

Hello,

I have a problem on my indicator that I have noted in the case of achieving Profit target and stop loss. How to modify code that notice was displayed only for a time?

For example: every 10 seconds

I tried using function : Sleep (), unfortunately without success.

Thank you for your help

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

//| expert initialization function |

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

extern bool Percent = true;

extern bool Play_Sound = true;

extern double Risk = 2.0;

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

//| expert start function |

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

int start()

{

//----

if (Percent == true)

if (Play_Sound == true)

double stop =AccountBalance()*(-Risk)/100;

double profit =AccountBalance()*(Risk)/100;

double floating_profit =AccountProfit();

{

if(StrToDouble(floating_profit) <= stop)

{

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

{

if(StrToDouble(floating_profit) >= profit) {

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

}}}}

//----

return(0);

}
 

Profit target and Stop loss indicator or EA

Hello,

I have a problem on my indicator that I have noted in the case of achieving Profit target and stop loss. How to modify code that notice was displayed only for a time?

For example: every 10 seconds

I tried using function : Sleep (), unfortunately without success.

Thank you for your help

//| expert initialization function |

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

extern bool Percent = true;

extern bool Play_Sound = true;

extern double Risk = 2.0;

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

//| expert start function |

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

int start()

{

//----

if (Percent == true)

if (Play_Sound == true)

double stop =AccountBalance()*(-Risk)/100;

double profit =AccountBalance()*(Risk)/100;

double floating_profit =AccountProfit();

{

if(StrToDouble(floating_profit) <= stop)

{

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

{

if(StrToDouble(floating_profit) >= profit) {

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

}}}}

//----

return(0);

}
 

Playsound and alert function

Hello,

I have a problem on my indicator that I have noted in the case of achieving Profit target and stop loss. How to modify code that notice was displayed only for a time?

For example: every 10 seconds

I tried using function : Sleep (), unfortunately without success.

Thank you for your help

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

//| expert initialization function |

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

extern bool Percent = true;

extern bool Play_Sound = true;

extern double Risk = 2.0;

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

//| expert start function |

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

int start()

{

//----

if (Percent == true)

if (Play_Sound == true)

double stop =AccountBalance()*(-Risk)/100;

double profit =AccountBalance()*(Risk)/100;

double floating_profit =AccountProfit();

{

if(StrToDouble(floating_profit) <= stop)

{

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

{

if(StrToDouble(floating_profit) >= profit) {

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

}}}}

//----

return(0);

}
 

SL and PT Alert EA

Hello,

I have a problem on my EA that I have noted in the case of achieving Profit target and stop loss. How to modify code that notice was displayed only for a time?

For example: every 10 seconds

I tried using function : Sleep (), unfortunately without success.

Thank you for your help

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

//| expert initialization function |

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

extern bool Percent = true;

extern bool Play_Sound = true;

extern double Risk = 2.0;

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

//| expert start function |

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

int start()

{

//----

if (Percent == true)

if (Play_Sound == true)

double stop =AccountBalance()*(-Risk)/100;

double profit =AccountBalance()*(Risk)/100;

double floating_profit =AccountProfit();

{

if(StrToDouble(floating_profit) <= stop)

{

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

{

if(StrToDouble(floating_profit) >= profit) {

if(Play_Sound) PlaySound("alert.wav");

Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());

}}}}

//----

return(0);

}
 
Files:
sb.mq4  7 kb
 

Any help with this one please?

I am using an arrow indicator in an EA, so when I activate the EA I do not get a value via icustom until the first arrow appears

What is the loop to check back in the indicator and find the last arrow value?

 

Hi guys,

can someone code this simple idea ..

if candle closes above a moving average ... give one alert ... untilcandle closes below the same moving average .. and also .. give one alert

Reason: