[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 211

 
Slepoy >> :

Question to Professionals . Please help me to output the MACDSample (standard in the terminal) into external variables of the MACD settings itself.

FastEMA
SlowEMA
SignalSMA

I can display it in properties but it doesn't work. Thanks in advance.

In external parameters of the Expert Advisor, insert

extern int FastEMA=12;

extern int SlowEMA=26;

extern int SignalSMA=9;

And then.

Where these numbers in the code are (12.26.9)

Instead of them, insert the specified variables, for example.

MacdCurrent=iMACD(NULL,0,FastEMA,SlowEMA,SignalSMA,PRICE_CLOSE,MODE_MAIN,0);

etc.

 
Slepoy писал(а) >>

Question to Professionals . Please help me to output the MACDSample (standard in the terminal) into external variables of MACD settings themselves.

FastEMA
SlowEMA
SignalSMA

I am not able to output them to the properties but they do not work. Many thanks in advance.

It looks like this

Files:
 
If we trade in the direction of the trend, we can take any Expert Advisor, even Ilan, and let it follow the trend and it will work very well.

When the price reverses, a bunch of orders will remain open and then a stop order triggers on the trailing equity.
If the trailing equity has not been activated, we have to close everything upon the opposite signal.
Frequent change of the signal is supposed to be a weak point. Although such a change is possible in flat conditions, in flat conditions, it may thresh and turn on trailing equity.
Or as an option, we can use the "second hand" if the signal appeared after several closed candles (adjustable parameter) after the last signal. Since the signal to the opposite direction may change quite frequently in flat conditions with a distance of 3-4 candles, but it does not happen too often.

I will explain the logic in details, and you will understand everything! When you open an Expert Advisor on a chart, it immediately opens two buy and sell positions with TP of 9 pips, but without any stops. The price starts to move somewhere from this point. One of the orders is closed by TP, the second order with the lot 2 times larger than the first one is added to the second one after 4 pips and if the price goes against these two orders, the third order with 2 times larger than the second one is opened after 4 pips and so on. If the price nevertheless has gone in a direction of these orders, they are closed on ТР and opposite orders by the same principle are opened. As a whole, all trading is performed near the level where the Expert Advisor was first launched. Thus, we need a strictly horizontal, prolonged flat around this level for our EA to start earning. Once the price moves away from this level, Uncle Kolya comes banging on your back.

In general, trailing equity. If equity grows to a certain level, trailing stops. When the equity bounces, you need to record a profit and wait until the next day.
If equity does not increase and goes in the red, losses are recorded on the amount of the fixed share (based on it, calculation of profit on equity for trailing).
The backtest of the Expert Advisor launched by trend during the last month.
In drawdown periods the trend changed and the EA traded against it, fixing the loss.
The growth is again following the trend.
Now think about how to integrate trend identifier, organize a reversal when trend changes... make a trailing stop for the last order in the chain
and some other tricks, like limit orders,
you will get an automated monster.

If you want to arrange a flip when the trend changes, a trailing stop for the last order in the chain and some more features, for example, limit orders operation, that is all.

We do not set a TP on the last order in a chain of open orders, but trailing stop.
If the order becomes the penultimate, we should remove its trailing stop and set a simple take and move the trailing stop to the very last order.
If trailing has changed on equity, we continue working as we were doing before.
3) If equity has not reached the trailing edge, after the signal changes
close everything.
Reopen in the direction of the signal.
a) false-true
If true, then we always roll in the direction of the opposite signal.
The best option only during backtesting.
Next:
When closing the cycle by trailing, fixed share loss limit or by
opposite signal, we wait for the next signal and
open.
a)false-true.
If true - then do not wait for the next signal, and open.
Immediately on the current one.
Approximately so ... only the backtest will show what is better
Files:
ejoh.mq4  12 kb
 
Good afternoon, smart guys, please help a little, how to write a script to delete objects not by name but by their style, we need to delete objects (name,OBJPROP_ARROWCODE,158), they are DOT, they are - point, how to do, tell anyone?
 

Доброго времени суток. Есть такой вопрос: хочу написать скрипт который будет рисовать фракталы на графике и сообщать о возникновении нового. пишу следующий код:

double a;
double b;

for (int x = 0; x < 20; x++)
{
a = iFractals(0,0,MODE_UPPER,5);
b = iFractals(0,0,MODE_LOWER,5);
if(a == 1)
Alert("up ");
else
if(b == 1)
Alert("down");
else
MessageBox("lox", "nax");
}
It works somehow, but it doesn't draw fractals on the chart. Could you please tell me the reason and how to make it work?

 

Gentlemen professionals, programmers and traders, please help in the next thread!

I can't do a couple of steps with the Expert Advisor, I just can't figure out the logic !

I can't figure out the logic !

Gentlemen, please help ! :"(

I will have an Expert Advisor in CodeBase !

Sorry for cluttering up the forum !

 

Hello, could you please tell me how to mark on the chart the execution moments of stoplosses and takeprofits? For example, I can mark the moments of market entry with colour in the OrderSend function, but what about SL and TP?

 

Thank you! That helped.

Now I'm struggling with a trailing stop based on parabolic(maybe someone can suggest a ready-made solution). I can't compare current price with isar readings. I try to do it this way.

extern double stepslow=0.005;
extern double maximumslow=0.05;

double sarslow = iSAR(NULL,0,stepslow,maximumslow,1);

double ASK = NormalizeDouble(Ask,Digits);
sarslow= NormalizeDouble(sarslow,Digits);
if( ASK < sarslow){ ....

}

I don't know what I'm doing wrong. Both normalized and not, all to no avail.

 
I think I've got it figured out. I couldn't get to this point in the code before.
 
Vinin >> :

>> Like this.

Thank you very much it's working. >> I'll keep looking into it.

Reason: