Metatrader 5 coding questions / issues - page 9

 

Don't worry Mladen, I guess I've figured out how to go about it. I'll post the idea when I'm through with it.

funayot:
Mladen, how can I code ea that executes this conditions:

Conditions:

1. If buy order(from indicator signal buffer2 is above buffer 1)

=open position

2. While open position, if take profit or trailing stop is hit, while the buy condition is still intact, wait for another fresh signal, even though buy condition is still intact.

For example, EMA 5 crosses EMA 34 and RSI above 50, buy. If take profit or trailing stop is hit, and buy condition is still intact, wait for another signal that is, buy condition/sell condition.

Thanks.
 

One peace of code reminded me what I hate in metatrader 5 : if you are making an indicator in a separate window, it is always going to draw level 0 regardless of what you want. Why is it so (why do they think that level 0 MUST be drawn in the subwindow) only the gods of metatrader 5 know

 

Seen some tests that are showing that current metatrader 4 is 2.5 times faster than metatrader 5 executing the same code. If it was a native code it could not happen

 
techmac:
Seen some tests that are showing that current metatrader 4 is 2.5 times faster than metatrader 5 executing the same code. If it was a native code it could not happen

TechMac, you are soo correct, why is it so slow? I have one indicator that bogs down my fast laptop, what will it be like under MT45? Guess its a goner.

 
Tzuman:
TechMac, you are soo correct, why is it so slow? I have one indicator that bogs down my fast laptop, what will it be like under MT45? Guess its a goner.

The only reason I can think of is that it is not native code at all (see when you have en error - it writes you out the exact line and starting position within line where it happens - that would not be possible if it was a native code or if it is not heavily stuffed with debug (read "decompile") info)

 

One thing that is often forgotten when metatrader 5 is concerned : you can not use multiple EAs on the same symbol. There is a magic number but since metatrader 5 only can open one position per symbol, you are left with an option to work with only one EA (otherwise the results can be completely unpredictable)

If they, by some magic, decide to do the same in the new metatrader 4, that will be interesting at the least

 

Where can I get an expert advisor (mt5) with dynamic stop loss/take profit. I will like to look in the code and learn how it is coded. The information that I have is that ATR values can be used but I don't know/understand how to code that. I will also like an expert advisor (mt5) that takes pivot points into consideration for entry, sl, tp and exit. Thanks.

 
funayot:
Where can I get an expert advisor (mt5) with dynamic stop loss/take profit. I will like to look in the code and learn how it is coded. The information that I have is that ATR values can be used but I don't know/understand how to code that. I will also like an expert advisor (mt5) that takes pivot points into consideration for entry, sl, tp and exit. Thanks.

funayot

Here is one example with atr trailing stops. It was originally posted here (by Nikolay Kositsin) : ATR_Trailing

Files:
 

What about EAs that take pivot point into consideration?

mladen:
funayot Here is one example with atr trailing stops. It was originally posted here (by Nikolay Kositsin) : ATR_Trailing
 
funayot:
What about EAs that take pivot point into consideration?

funayot

Didn't see such (metatrader 5 version) so far

Reason: