# Experts: MARTINGALE VI HYBRID - page 5

17

1. Take profit and stop loss should be greater than the specified value, in your case 30 pips.

2. You can't set StopLoss, You can use "MaxTrade=3"  + "CLOSEMAXORDERS=1\CLOSEMAXORDERS=true" ,

so after 3 (Or any other number  you set on "MaxTrade") losing trades you can close all trades with relatively small loss.

3. MagicNumber:A magic number should be a different number for each currency pair you trade in. when you trade with multiple pairs with the same robot(EA) on one platform

-"MagicNumber: May be used as user defined identifier." (MQL4 Reference).

Thanks.

Is hard to set any INT for the StopLoss like TP? We can choise TP from the setting, i think is not hard to set SL too, right?

Thanks!

Moderator
13043

DDangerous:

Thanks.

Is hard to set any INT for the StopLoss like TP? We can choise TP from the setting, i think is not hard to set SL too, right?

Thanks!

36295

Marco vd Heijden:

The EA trades with martingale' If you put a stop loss you will  change the character of the EA and cause losses, you can stop all trades once you have reached the maximum loss trades you set,

5

Hi, Aharon.

First congratulate you for this magnificent, I had a couple of questions that I would like to comment.

The first of it in the code you put the following:

switch ( Period ()) // Calculating coefficient for ..
{ // .. different timeframes
case       1 : T = PERIOD_M15 ; break ; // Timeframe M1
case       5 : T = PERIOD_M30 ; break ; // Timeframe M5
case      15 : T = PERIOD_H1 ; break ; // Timeframe M15
case      30 : T = PERIOD_H4 ; break ; // Timeframe M30
case      60 : T = PERIOD_D1 ; break ; // Timeframe H1
case     240 : T = PERIOD_W1 ; break ; // Timeframe H4
case    1440 : T = PERIOD_MN1 ; break ; // Timeframe D1

In the description does not agree with the period, what is wrong description? Do they not take into account the periods of m5 and m1?

```The second question is the following:

In this part of the code:```

/* -- This is where you insert coding indicators to trigger a trade --*/
double FAST_MA=iMA(NULL,0,FASTMA,0,MODE_SMA,PRICE_CLOSE,1);
double SLOW_MA=iMA(NULL,0,SLOWMA,0,MODE_EMA,PRICE_CLOSE,1);
double  MacdMAIN=iMACD(NULL,T,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
double  MacdSIGNAL=iMACD(NULL,T,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);
Comment(EAName);             // Show EA Name  on screen

```Is the value of T for each of the periods or only for the period that is being viewed at the time?

Thank you all and for sharing this great advisor.

a greeting```
36295

Raikan:

Hi, Aharon.

First congratulate you for this magnificent, I had a couple of questions that I would like to comment.

The first of it in the code you put the following:

switch ( Period ()) // Calculating coefficient for ..
{ // .. different timeframes
case       1 : T = PERIOD_M15 ; break ; // Timeframe M1
case       5 : T = PERIOD_M30 ; break ; // Timeframe M5
case      15 : T = PERIOD_H1 ; break ; // Timeframe M15
case      30 : T = PERIOD_H4 ; break ; // Timeframe M30
case      60 : T = PERIOD_D1 ; break ; // Timeframe H1
case     240 : T = PERIOD_W1 ; break ; // Timeframe H4
case    1440 : T = PERIOD_MN1 ; break ; // Timeframe D1

In the description does not agree with the period, what is wrong description? Do they not take into account the periods of m5 and m1?

/* -- This is where you insert coding indicators to trigger a trade --*/
double FAST_MA=iMA(NULL,0,FASTMA,0,MODE_SMA,PRICE_CLOSE,1);
double SLOW_MA=iMA(NULL,0,SLOWMA,0,MODE_EMA,PRICE_CLOSE,1);
double  MacdMAIN=iMACD(NULL,T,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
double  MacdSIGNAL=iMACD(NULL,T,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);
Comment(EAName);             // Show EA Name  on screen

The main idea here is to work on two parallel time frames at the same time, ie: if you are in a daily time frame chart then we have a confirmation of the trend within a weekly time frame  (here it is done with the help of MACD indicator)and so on...

"switch ( Period ()) "-"switch" operator switches between time frames of Period() function as follows:

Chart Timeframes

All predefined timeframes of charts have unique identifiers. The PERIOD_CURRENT identifier means the current period of a chart, at which a mql4-program is running.

ENUM_TIMEFRAMES

 ID Value Description PERIOD_CURRENT 0 Current timeframe PERIOD_M1 1 1 minute PERIOD_M5 5 5 minutes PERIOD_M15 15 15 minutes PERIOD_M30 30 30 minutes PERIOD_H1 60 1 hour PERIOD_H4 240 4 hours PERIOD_D1 1440 1 day PERIOD_W1 10080 1 week PERIOD_MN1 43200 1 month

Ie:if you are on 1M (1) time frame chart then the value of "T"=M15 (the time frame of "T" goes into MACD indicator so we have a check on the higher time frame-M15)

if you are on M5 (5) time frame chart then the value of "T"=M30 time frame, and so on.

Moderator
13043

The EA trades with martingale' If you put a stop loss you will  change the character of the EA and cause losses, you can stop all trades once you have reached the maximum loss trades you set,

Of course, but that doesn't mean that it isn't possible for @DDangerous

He likes to play on the dangerous side, you can tell.

144

Hi Aharon,

I'm trying to backtest Hybrid and having trouble that it closes at stop with only one trade. What am I doing wrong. As it's a test ex4, I can't tweak anything in the mq4 ;)  . I'm noticing though that it uses the Multiply input parameter instead of the Lots, is this an issue or deliberate?

36295

Stephen Eriaku:

Hi Aharon,

I'm trying to backtest Hybrid and having trouble that it closes at stop with only one trade. What am I doing wrong. As it's a test ex4, I can't tweak anything in the mq4 ;)  . I'm noticing though that it uses the Multiply input parameter instead of the Lots, is this an issue or deliberate?

You need to set minimum values under "start",small step values under "step" and maximum values under "stop"  as described in product page and then run back test,if you did not try to do back test before than you need to learn,this is not the place to explain how to perform back testing,please google it and learn,multiply is only for martingale and zone recovery,and it works with the lot not insted,the value of lot in first trade is always the smallest.

23

hi aharon,

i just try ur update ea, but in BT the result is not better then  the old one, may i know ur new result and the setfile. maybe next u can add for news trap in this ea

thanks

36295

rubika88:

hi aharon,

i just try ur update ea, but in BT the result is not better then  the old one, may i know ur new result and the setfile. maybe next u can add for news trap in this ea

thanks

I can not talk here about product, only on free version.