Temporary storage of data by an MT4 or MT5 robot is that possible???

Good morning,

I will have a Robot to code but before describing my need to Freelance programmers I wanted to know if MT4 or MT5 were able to do this:

Roll out a strategy (such as an entry on the crossing of the short and long moving averages)
With a TP determined from the last 40 trades made previously
This TP could be set, for example, at half of the maximum levels reached the last 40 times the strategy was triggered (therefore the last 40 crossings of short and long moving averages)
I suppose that each time the moving average crossovers occur the robot must store the maximum values reached before a new inverse moving average crossover but can an MT4 or MT5 robot store this type of data or not at all?

If this is possible with type of variable/function? (without going into detail, just a few indications so that I can specify it when I make my robot programming request to the platform programmers)

Thank you in advance for your answers.


Hello god . Yes

It could be like this :

Looking for an EA that operates on fast / slow ma crossovers .

When the ea starts it should scan the history of the symbol it is attached to , only the native timeframe , and collect data about each range between 2 ma crossovers

An ma crossover range is the area of the chart between 2 ma crossovers .

From this area the ea should remember : 

  • The maximum price as tp if the crossover (the left in the range) is the fast going above the slow ma.
  • The minimum price as sl if the crossover (the left in the range) is the fast going above the slow ma.
  • The opposite for when the fast goes below the slow ma 

The sl and tp must be calculated as a distance from a hypothetical open price  and that open price should be considered the moment in time when we "see" the ma cross (not the bar on the cross)

The sl and tp must be collected and maintained in a list for each trade type (buy/sell) so when a live crossover happens we can instruct the ea to calculate the average of the top/bottom x amount  40 most recent sl/tp stored in the lists to decide upon the size of the sl and tp for the live trade.

Any new crossover ranges that conclude must also be added in the collection


It's excellent !!!!

Thank you so much.

The most important term I was missing was storing SL and TP in a list...

You understood perfectly and very quickly.

This will help me effectively describe my need to a freelancer.

Have a great day and thank you for taking the time to reply !!!!