# Code a Robot EXPERT ADVISOR - 100% Winner..

Hello .. I imagined a robot, so it will only be theory.

Here's the idea:

Imagine 2 boxes, a Winner AND a Loser.
The robot will be of the scalping type on the closing of the candle, it will accumulate (in cache) at each opening; profit or loss in the corresponding box.
We could adjust the 2 boxes to set a take profit and adjust the Losing box so that it empties ... That's it.
In fact, will be a function "If" in the direction or if Take Profit reaches for example 10 pips then collection of TP
If the Losing box accumulates 10 pips, the EA clears the cache of the 2 boxes and new cycle, it starts again.

I don't know if I was clear.
In fact the robot accumulates gains and losses and once reached according to the setting it collects or empties the caches.
This logically means NO LOSS possible!

The opening of position will of course be based on a percentage of the capital.

Your opinion .. Is it possible to code this?

Good to you :)

Example of a Winner scenario.

The robot opens in DAX30 a position on 5mn graph.
at the closing of the 1st candle, it closes in negative at 2 pips. The cover of the "LOSS" box is filled with 2 pips.
at the closing of the 2nd candle, it fills the "LOST" box again and adds 3 pips, we are at 5 losing pips in the box (pending)
at the closing of the 3rd candle, it closes in positive at 10 pips. The box has reached its cumulative TP, the EA therefore collects the 10 pips and empties the 5 pips from the other box .. to go into oblivion.

Example of a Loser scenario.

The robot opens in DAX30 a position on 5mn graph.
at the closing of candle N ° 1 it is 3 pips lost, cached in the "loss" box
at the end of candle N ° 2 it's 4 pips lost, cached in the "loss" box
at the close of candle N ° 3 it is 4 pips lost again, we arrive at 11 pips, the 10 are reached and exceeded, the robot empties all the caches (the 2 boxes)
we gain nothing, we lose nothing.

it restarts the machine. to infinity and accumulates the gains.

NB --- XXX --- Equal adjustable value to define.

The code will give kke something like
opening at --- 2% --- of the position.
after closing of the candle compared to the previous one, if gain, memorize in the "GAIN" box and accumulate up to --- 10 pips ---
.................................................. ................................, if lost, store in the "LOSS" box and accumulate up to - -5 pips ---
If GAIN is reached, then take the Take Profit. (and empty the LOSS box)
If LOSS reached, then Empty the 2 caches, they never existed.
The process starts from zero and it opens positions without stopping.
It will open according to the previous candle. (why not HEIKEN ASHI) if bullish candle "BUY" otherwise "SELL"

Keep me posted, we could be a team of kke people who know programmed this idea ..
We all have to WIN! Thank you in advance.

YH

is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
Files:
SHEMA01.png  193 kb

use automatic translation feature from/to the languages to read and to write:
https://www.mql5.com/en/forum/13348

for example, you can write the post in your language, after that - use this in-built translation feature, your text will be stanslated to the English, and after that - press 'Add your comment'. And your post will be in English.

Automatic Translation of MQL5.com Forum Messages from Any Language
• 2013.08.09
• www.mql5.com
MQL5.com forum now features automatic translation of any messages...

aRka3579 :

Hello .. I imagined a robot, so it will only be theory.

Here's the idea:

Imagine 2 boxes, a Winner AND a Loser.
The robot will be of the scalping type on the closing of the candle, it will accumulate (in cache) at each opening; profit or loss in the corresponding box.
We could adjust the 2 boxes to set a take profit and adjust the Losing box so that it empties ... That's it.
In fact, will be a function "If" in the direction or if Take Profit reaches for example 10 pips then collection of TP
If the Losing box accumulates 10 pips, the EA clears the cache of the 2 boxes and new cycle, it starts again.

I don't know if I was clear.
In fact the robot accumulates gains and losses and once reached according to the setting it collects or empties the caches.
This logically means NO LOSS possible!

The opening of position will of course be based on a percentage of the capital.

Your opinion .. Is it possible to code this?

Good to you :)

Example of a Winner scenario.

The robot opens in DAX30 a position on 5mn graph.
at the closing of the 1st candle, it closes in negative at 2 pips. The cover of the "LOSS" box is filled with 2 pips.
at the closing of the 2nd candle, it fills the "LOST" box again and adds 3 pips, we are at 5 losing pips in the box (pending)
at the closing of the 3rd candle, it closes in positive at 10 pips. The box has reached its cumulative TP, the EA therefore collects the 10 pips and empties the 5 pips from the other box .. to go into oblivion.

Example of a Loser scenario.

The robot opens in DAX30 a position on 5mn graph.
at the closing of candle N ° 1 it is 3 pips lost, cached in the "loss" box
at the end of candle N ° 2 it's 4 pips lost, cached in the "loss" box
at the close of candle N ° 3 it is 4 pips lost again, we arrive at 11 pips, the 10 are reached and exceeded, the robot empties all the caches (the 2 boxes)
we gain nothing, we lose nothing.

it restarts the machine. to infinity and accumulates the gains.

NB --- XXX --- Equal adjustable value to define.

The code will give kke something like
opening at --- 2% --- of the position.
after closing of the candle compared to the previous one, if gain, memorize in the "GAIN" box and accumulate up to --- 10 pips ---
.................................................. ................................, if lost, store in the "LOSS" box and accumulate up to - -5 pips ---
If GAIN is reached, then take the Take Profit. (and empty the LOSS box)
If LOSS reached, then Empty the 2 caches, they never existed.
The process starts from zero and it opens positions without stopping.
It will open according to the previous candle. (why not HEIKEN ASHI) if bullish candle "BUY" otherwise "SELL"

Keep me posted, we could be a team of kke people who know programmed this idea ..
We all have to WIN! Thank you in advance.

YH

Good for you.

Why have we never thought of this before?!!

Reason: