新しいローソク足でトレードを開始
27 replies
こんにちは
I just want a rule that says as soon as a new candle opens, then enter a trade. Can anyone tell me how?\
ありがとう
0
On the Open P/L I can see it has a magic number, so its only going to look at the trade with that magic number. The only thing I can think of is that the value in pips of both trades should be assigned a variable each, and then the two variables added together. I just can’t see how to do it?
0
I think I solved that. But its still not opening trades on the 2nd currency pair. Can you take a look at the strategy file attached and see if I have done anything wrong?
ありがとう
0
One last problem with this strategy…
I am adding the open p/l together for both currencies and the rule is, if the total profit is >= 5 pips then close both trades.
However, its closing at 5 pips regardless of whether its 5 pips profit or 5 pips loss, or 3 pips profit and 2 pips loss etc.
How do I ensure it only closes when the open p/l is positive 5 pips?
0
I am adding the open p/l together for both currencies and the rule is, if the total profit is >= 5 pips then close both trades.
However, its closing at 5 pips regardless of whether its 5 pips profit or 5 pips loss, or 3 pips profit and 2 pips loss etc.
How do I ensure it only closes when the open p/l is positive 5 pips?
0
can you attach your strategy here? it should recognize between positive and negative PL.
マーク
StrategyQuantアーキテクト
0
and it will return open profit for all trades on the same symbol.
The solution is to use custom function, but don’t worry, it is not complicated.
Open file EA Wizard/code/CustomFunctions.mq4 and add the following function there:
マーク
StrategyQuantアーキテクト
0
Thanks Mark, thats very helpful.
0
マーク
This is a very interesting strategy which I was looking test. Unfortunately, when i add the code above to CustomFunctions it doesn’t compile and shows the errors
Actually when I removed the additional code the last 2 errors still exist
Can you advise please
ありがとう
Eddie
0
Hello Eddie,
are you trying to compile the COmpiledFunctions.mq4 file by itself?
It isn’t supposed to work like this. The contents of this file is attached to every EA created in EA Wizard, so don’t compile this custom file, but normal EA that you export from EA Wizard.
It should have these functions already included.
マーク
StrategyQuantアーキテクト
0
Thanks for that Mark
It is now working and gives me the basis of something to try and develop
乾杯
0