You need to describe the algorithm procedure for the Counter-Order Strategy (something like a Martingale Strategy, but not quite).

 

Hello, Question to MQL5 programmers and developers, how difficult is it to write a strategy for MT5 and how do you rate it? I drew my algorithm in Excel, sorry - look at the picture.

The original name of the algorithm is ALGO_BLACKJACK&HOOKERS.



ANALYSIS
Moving Average analysis The robot analyzes the Moving Average line for the last hour and opens a buy or sell position without looking for an entry point. Buy - if the difference in Value on the start and end points of the Moving Average is positive, sell - if it is negative.

FIRST POSITION
Opening of first position buy or sell IF first position => 60 pips. (60, 61...) THEN close position, IF first position => -30 pips (-30, -31...) THEN the second position.

SECOND POSITION
second position opening IF first position is buy, THEN second position is sell, IF first position is sell, THEN second position is buy.

THIRD POSITION
Open a third position. IF second sell position => -30 pips. (-30, -31...) THEN third position buy. IF second sell position => 30 pips. (30, 31...) THEN the third sell position. IF second buy position => 30 pips. (30, 31...) THEN the third buy position. IF second buy position => - 30 pips. (-30, -31...) THEN the third sell position.

CLOSE

IF SUMPLETE first position + second position + third position = 60 pips (60, 61...) (60, 61...) THEN CLOSE all positions of the instrument. IF SUMS first position + second position + third position => - 60 pips. (-60, -61...) THEN close all positions for the instrument. ALGORITHM RESERVE: IF AMOUNT first position + second position + third position => 0 pips (0, 1...) (0, 1...) THEN close all positions for the instrument.


RISKS

A strategy's risks are defined as the ratio of the number of profitable or losing outcomes to the total number of possible outcomes. There are 5 outcomes in total, since 1 outcome is profitable at the beginning, 2 outcomes are profitable at the end and 2 outcomes are unprofitable at the end. Total probability of profit is 3/5 or 0.6, probability of loss is 2/5 or 0.4, i.e. 10 trades give returns of 360p, losses of 240p and net profit of 120p. Profitability of the algorithm is 20%.


Additional question: is it possible to hold two or more buy and/or sell positions on the same instrument?

I have a THEME (link) about counter-orders. Actually the algorithm doesn't give any predictions, only optimization of performance.

Basically the usual)))


09/04/2017

Sorted out the lots, quotes and profit in dollars now. Thanks to two comrades from chat :) In general if classic EUR/USD: 60 points of profit at 1:100 leverage on 0.1 lot it's 6$ profit. See the calculator. With 1.0 lot 60 points = 60$ with a leverage of 1:100. I think that catching 60 points for the sake of 6 dollars is unprofitable. That's why I will work with 1.0 lot. I don't think it is worth it to catch 60 pips. 60$ at 1.0 lot is worth the time and fuss, but the risks... the risks... That's why we're looking for an algorithm more or less reliable for the robot.

 
geratdc:



As usual.))

As usual I have been coming back to this EA from time to time for several years with new ideas on how to destroy accumulated lots and losses, but all in vain. If you are able to create such an algorithm, but it works and proven, please contact me. :-)))
 
geratdc:

Hello, Question to programmers or developers, advise how difficult it is to write a strategy for the MT5 and how you estimate it? I have an algorithm in excelsior - look at the picture.


ANALYSIS
The robot analyses the Moving Average line over the last hour and opens a buy or sell position without searching for an entry point. Buy - if the difference of Value on the start and end points of the Moving Average is positive, sell - if it is negative. It means that the robot opens (connects) a position to the trend.

FIRST POSITION
First position buy or sell open (IF first position => $50 (50, 51...) THEN close position, IF first position => -40$ (-40, -41...) THEN second position).

SECOND POSITION
second position opening IF first position is buy, THEN second position is sell, IF first position is sell, THEN second position is buy.

THIRD POSITION
Open a third position. IF second sell position => -40$ (-40, -41...) THEN third buy position. IF second sell position => $40 (40, 41...) THEN third sell position. IF second buy position => $40 (40, 41...) THEN third buy position. IF second buy position => -$40 (-40, -41...) THEN third sell position.

CLOSE
Close all positions of the instrument (IF first position => $50 (50, 51...) THEN close the position. IF sum of first position + second position + third position => $50, then all positions are closed).

Additional question: is it possible to hold two or more positions by buy and/or sell on the same instrument?

I have a THEME (link) about counter-orders. Actually the algorithm doesn't give any predictions, only optimization of performance.

In general, as usual)))


It's funny, but I'm doing such a class on mql5 right now))) But it's too mechanistic with you, it's more deadly with me.

In MT5 hedge accounts we mayhold two or more positions to buy and/or sell on the same instrument.

 

Folks, I'm new to MT5.

At least find a weak spot in the algorithm and explain why it is weak. Let's think it over together. It is clear that the programming is more complicated, but if the algorithm works, then why shouldn't the program work? Let me remind you that the algorithm doesn't predict anything, it simply optimizes performance.

Can you see what is going on in mydemo account? This robot-algorithm would probably bring order to me.

 
geratdc:

Folks, I'm new to MT5.

At least find a weak spot in the algorithm and explain why it is weak. Let's think it over together. It is clear that the programming is more complicated, but if the algorithm works, then why shouldn't the program work? Let me remind you that the algorithm doesn't predict anything, it simply optimizes performance.

Can you see what is going on in mydemo account? Perhaps such a robot-algorithm would help me get things in order.

No, we do not, we are not telepathic.

IF first position => -$40 ..... and so on. We should not work by levels, the first of the mistakes.

 
Alexey Volchanskiy:


It's funny, but I'm doing such a class on mql5 right now ))) But yours is too mechanistic, mine is more deadly.

In MT5 hedge accounts, you canhold two or more buy and/or sell positions on the same instrument.


Everything is OK now. Thank you. Because I was afraid that identical orders would be removed.
 
Alexey Volchanskiy:

No, we don't, we're not telepathic.

IF first position => -$40 ..... and so on. We should not work by levels, the first of the mistakes.


Please decipher what it means? How it should be.
 
geratdc:

I have one for robot. Please explain what it means. How it should be.


If I knew how, I would have done it a long time ago )) But not stupidly by levels.

I use the rate of price change to determine the amount of a counter-order. But it's not for manual trading, and you seem to have it. It's hard to calculate it by hand. I have it for robot.

 
geratdc:

Can you please decipher what this means? How to do it.

By the way, I can let you test it if you like. I will make it into a separate mini EA to cover the loss. Do you want me to register it as a tester?
 
Alexey Volchanskiy:

By the way, I'll show you the results - I can let you test them, if you want. I will make it as a separate mini EA to close the loss. Register me as a tester?


I do not understand anything about it. I do not understand the difference between Expert Advisor and Expert Advisor. If you are able to explain what is what, we will try it.


In general I closed my counter orders as I'm draining. 700 dollars left in the eedmo account out of 3000. And yesterday morning there were 7 100 !!! The losses accumulated and the system closed them forcibly to me because there was not enough free margin lzk to pay for the transfer of positions (swaps).

 
Alexey Viktorov:
As usual I've been coming back to this EA from time to time over the years with new ideas on how to break the accumulated locks and losses, but all in vain. If you are able to create such an algorithm, but it works and has been tested, please contact me. :-)))

Why are you all working on this one by one? Is it difficult for you programmers to work together and describe a more or less working strategy? Please describe the algorithm, if it's not too much trouble. I just do not know when I will get to this level to do it myself. I will study it little by little. Do you have any good references on MT5 programming for dummies?
Reason: