Ask! - page 14

 

Journal assistant

I was reading another thread and had the following idea:

labrat407:
Hello everyone, I am new to here and to Forex. I was thinking about this a few days ago and this topic peaked my interest. I know you can do chart captures from MT4 ( I have not done it yet as I am still getting used to the package). My question/Request is this:

Are you able to set the Chart capture function up like an indicator?

eg1: You are testing an Indicator/EA/system, but can not be there all the time. When the indicator provides a signal then the Capture function is set off.

eg2:You have an EA and it is live trading, the Capture goes off when the open or close is set off for a trade.

Is this possible? I think this would be a great assist to Journaling your trades.

Can this be done? Since I am not at my PC all day I would like to have this run for my demo accounts and be able to look back at the trades.

Thanks for any help

-------------------------

On the path to personal success one meets many people.

Learn from the ones who have failed and offer help.

Learn more from the ones who have succeeded, and thank them for their help!

 

If you have a look at this thread:

http://strategybuilderfx.com/showthread.php?t=16628

you will find there a quite promising strategy developed. For faster backtesting a simple indicator is needed which draws horizontal lines at the open price of 6 am CET which is 4 am GMT candle and then on every 25 pip higher and lower for the day, on the next day the lines are redrawn according to the price at 6 am CET. So if someone has an indicator capable of this please post it here. I will be very thankful.

 

edited: i succesfully done it

 

I have been trying to get some help to put an alert in the stopreversal indicator, when the arrows show.

I had a try using the info shown in the "How to add alarm to any indicator " doc but not having success so far, here is what I found

This indicator uses different indicator array to the one mentioned in the "How to" doc

Instead of

SetIndexBuffer(0,ExtMapBuffer);

SetIndexBuffer(1,ExtMapBuffer2);

It uses this

void SetIndexValue(int shift, double value)

{

ExtHistoBuffer[shift] = value;

}

void SetIndexValue2(int shift, double value)

{

ExtHistoBuffer2[shift] = value;

}

there seems to be no if statement as mentioned in the "How to set an alarm doco"? Help!

Also, when I use Alert("Some sound and window"); is there a function to play another alert sound

I tried Playsound("alert2.wav") but then I get 2 sounds

Files:
 

Here's my problem...

https://www.mql5.com/en/forum/174380

hope you might be able to help!

 
 

Coders Guru Help

Hi,

Mr. Guru could you please help me to constantly refresh an ea after each tick movement.

I have tried everything, But I just can't make it refresh constantly.

Tnx

 

Help to convert this language to MT 4

hello guys,

my friend ask me for help to convert this MetaStock code to MT4.. i don't know what how to convert..but i believe it has something to do with zigzag pointer and moving average.. so for seasoned programmer... please help me translate this code...

mov (zig,4,c),5,e

he gives me hint that it use value form zigzag indicator with parameter 4 on closed price and the value is given to Exponential moving average with period 5.

but wonder which zigzag signal should i use ? also how the value (which i assume a pair level) could given to process to another indicator

Please help me.. thank you

 

Hello there!

I seem to be stuck in loop here and wonder if someone has been there, done ?, and broke out of loop

Over at MetaQuotes http://www.metaquotes.net/forum/1916 is thread about the dictionary small text.

Slawa gives directions for possible work around - but this is to my mind a con and since these guys must know a thing or two about Windows coding etc, I'd expect more robust fix... like an update

To add insult to injury [for me anyway] the actions do not make any difference to my setup.

I have latest ME,MT,IE,XP pro sp2,blah,blah...

Sure would appreciate someone putting me outta my misery

Cheers

ah yes - I sure like the threads & posts, so much to learn [as usual...]

 

I want to learn how to use this tool. http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/

I made a EA and compiled it and got these 6 errors...

'.' - initialization expected C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (16, 22)

'1' - comma or semicolon expected C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (16, 23)

'Lots' - variable not defined C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (179, 44)

'Lots' - variable not defined C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (187, 47)

'Lots' - variable not defined C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (206, 44)

'Lots' - variable not defined C:\Program Files\Interbank FX Trader 4\experts\macdstochma5m.mq4 (214, 48)

would someone assist me in correcting these errors, I just learned how to compile but I don't know how to code.

here is the code ...

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

//| This MQL is generated by Expert Advisor Builder |

//| http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/ |

//| |

//| In no event will author be liable for any damages whatsoever. |

//| Use at your own risk. |

//| |

//| Please do not remove this header. |

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

#property copyright "Expert Advisor Builder"

#property link "http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/"

extern int MagicNumber = 0;

extern bool SignalMail = False;

extern bool EachTickMode = False;

extern double Lots = .1;

extern int Slippage = 3;

extern bool StopLossMode = True;

extern int StopLoss = 12;

extern bool TakeProfitMode = True;

extern int TakeProfit = 90;

extern bool TrailingStopMode = True;

extern int TrailingStop = 12;

#define SIGNAL_NONE 0

#define SIGNAL_BUY 1

#define SIGNAL_SELL 2

#define SIGNAL_CLOSEBUY 3

#define SIGNAL_CLOSESELL 4

int BarCount;

int Current;

bool TickCheck = False;

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

//| expert initialization function |

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

int init() {

BarCount = Bars;

if (EachTickMode) Current = 0; else Current = 1;

return(0);

}

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

//| expert deinitialization function |

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

int deinit() {

return(0);

}

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

//| expert start function |

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

int start() {

int Order = SIGNAL_NONE;

int Total, Ticket;

double StopLossLevel, TakeProfitLevel;

if (EachTickMode && Bars != BarCount) TickCheck = False;

Total = OrdersTotal();

Order = SIGNAL_NONE;

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

//| Variable Begin |

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

double Buy1_1 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 2, 1, 0, 1, Current + 0);

double Buy1_2 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 5, 1, 0, 1, Current + 0);

double Buy2_1 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 9, 1, 0, 1, Current + 0);

double Buy2_2 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 9, 1, 0, 1, Current + 1);

double Buy3_1 = iMACD("EURUSD", PERIOD_M1, 4, 9, 7, PRICE_CLOSE, MODE_SIGNAL, Current + 0);

double Buy3_2 = iMACD("EURUSD", PERIOD_M1, 4, 9, 7, PRICE_CLOSE, MODE_SIGNAL, Current + 1);

double Buy4_1 = iMA("EURUSD", PERIOD_M1, 2, 0, MODE_EMA, PRICE_CLOSE, Current + 0);

double Buy4_2 = iMA("EURUSD", PERIOD_M1, 5, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double Sell1_1 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 2, 1, 0, 1, Current + 0);

double Sell1_2 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 5, 1, 0, 1, Current + 0);

double Sell2_1 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 9, 1, 0, 1, Current + 0);

double Sell2_2 = iCustom("EURUSD", PERIOD_M1, "StepMA_Stoch", 9, 1, 0, 1, Current + 1);

double Sell3_1 = iMACD("EURUSD", PERIOD_M1, 4, 9, 7, PRICE_CLOSE, MODE_SIGNAL, Current + 0);

double Sell3_2 = iMACD("EURUSD", PERIOD_M1, 4, 9, 7, PRICE_CLOSE, MODE_SIGNAL, Current + 1);

double Sell4_1 = iMA("EURUSD", PERIOD_M1, 2, 0, MODE_EMA, PRICE_CLOSE, Current + 0);

double Sell4_2 = iMA("EURUSD", PERIOD_M1, 5, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double CloseBuy1_1 = iMA("EURUSD", PERIOD_M1, 2, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double CloseBuy1_2 = iMA("EURUSD", PERIOD_M1, 5, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double CloseSell1_1 = iMA("EURUSD", PERIOD_M1, 2, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double CloseSell1_2 = iMA("EURUSD", PERIOD_M1, 5, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

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

//| Variable End |

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

//Check position

bool IsTrade = False;

for (int i = 0; i < Total; i ++) {

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {

IsTrade = True;

if(OrderType() == OP_BUY) {

//Close

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

//| Signal Begin(Exit Buy) |

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

if (CloseBuy1_1 < CloseBuy1_2) Order = SIGNAL_CLOSEBUY;

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

//| Signal End(Exit Buy) |

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

if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Close Buy");

if (!EachTickMode) BarCount = Bars;

IsTrade = False;

continue;

}

//Trailing stop

if(TrailingStopMode && TrailingStop > 0) {

if(Bid - OrderOpenPrice() > Point * TrailingStop) {

if(OrderStopLoss() < Bid - Point * TrailingStop) {

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

if (!EachTickMode) BarCount = Bars;

continue;

}

}

}

} else {

//Close

.....continued on next post

Reason: