A simple expert advisor scanning multiple codes

MQL5 Experts C++

Tâche terminée

Temps d'exécution 4 jours
Commentaires du client
Very helpful
Commentaires de l'employé
Thanks! Nice customer.. hoping that we will work together again:)

Spécifications

I am very novice in programming a robot and I would like to develop the following EA. Overall the robot is looping continuously over a large number of symbols performing a few calculations on those symbols prices and deciding if it wants to buy or sell. I want no two open positions for the same symbol and also no position exchange (no positions should be closed to open new ones). For each open position of a symbol, the robot will need to find the buying price for that position and the day the position was opened as this is important information for determining the selling point.


I am not sure if one script can loop over several symbols (some users suggest that each tick function can only be employed on a single symbol). I am open to your suggestions (possibly copying pasting the code multiple times to scan various symbols or similar solution. I will need a couple of market days to test the code myself. See below for full annotation:



void OnTick()

  {

\\ Define a list of codes (approximately 500 codes in reality) to be checked. I have unsuccessfully tried defining an array and looping through those symbols. Possibly this is not the right solution (maybe you need to run OnTicks for each code separately. )

string symbol_array[]={"XOM","AAL","ABNB"};

int number_of_symbols=ArraySize(symbol_array);

Print("Total number of symbols is =",number_of_symbols);


for(int symbol_position=1;symbol_position<=number_of_symbols;symbol_position++)

{string stockname=symbol_array[symbol_position];

Print("Current symbol is =",stockname); 


\\ Do some simple calculations on the selected symbol, i.e. take its few last closing prices - No changes needed

double   Current_close = iClose(stockname,PERIOD_M1,0);

double   Close_minus1 = iClose(stockname,PERIOD_M1,1);

double   Close_minus2 = iClose(stockname,PERIOD_M1,2);

double   Close_minus3 = iClose(stockname,PERIOD_M1,3);

double   High_minus_1day = iHigh(stockname,PERIOD_D1,1);

double   High_minus_2day = iHigh(stockname,PERIOD_D1,2);

double   High_minus_3day = iHigh(stockname,PERIOD_D1,3);

double   High_minus_4day = iHigh(stockname,PERIOD_D1,4);

double   High_minus_5day = iHigh(stockname,PERIOD_D1,5);

double   High_minus_6day = iHigh(stockname,PERIOD_D1,6);

double   High_minus_7day = iHigh(stockname,PERIOD_D1,7);

double   High_minus_8day = iHigh(stockname,PERIOD_D1,8);


\\ Calculate a simple index of the trend pattern and also some local percentage changes and derivatives.  - No changes needed

double   Trending_pattern = (High_minus_4day+High_minus_3day+High_minus_2day+High_minus_1day) - (High_minus_8day+High_minus_7day+High_minus_6day+High_minus_5day);

double   Percentage_move3 = (Current_close-Close_minus3)/Close_minus3;

double   Percentage_move2 = (Current_close-Close_minus2)/Close_minus2;

double   Percentage_move1 = (Current_close-Close_minus1)/Close_minus1;

double   Local_derivative = Close_minus2/2 - 2*Close_minus1 +3*Current_close/2;


\\ Generate a buy signal IF Trending_pattern>0 && Local_derivative>0.05 && NO orders are pending for this code and NO positions are open for this code.

I do not want to exchange (close positions to open new ones) any currently open position. I do not know how to implement the 'NO orders should be pending and the 'NO open positions should exist for this code' parts. Please help me with this.

//buy signal

if ( Trending_pattern>0 && Local_derivative>0.05 && OrdersTotal()==0 )

{

   MqlTradeRequest request={0};

   MqlTradeResult  result={0};

//--- parameters of request

   request.action   =TRADE_ACTION_DEAL;                     // type of trade operation

   request.symbol   =stockname;                              // symbol

   request.volume   =1;                                   // volume of 0.1 lot

   request.type     =ORDER_TYPE_BUY;                        // order type

   request.deviation=5;    


OrderSend(request,result);

}


\\ Generate a SELL signal IF 'the current selling price Current_close of an open position for the current code is 1.1 times the price I have bought it in the past' OR 'the position for this code was opened more than 3 days ago'.

I do not know how to implement either of these 2 conditions. Please help me with that.

//sell signal

if (Current_close >1.1*Price_paid_for_position)

{

   MqlTradeRequest request={0};

   MqlTradeResult  result={0};

//--- parameters of request

   request.action   =TRADE_ACTION_DEAL;                     // type of trade operation

   request.symbol   =stockname;                              // symbol

   request.volume   =0.1;                                   // volume of 0.1 lot

   request.type     =ORDER_TYPE_SELL;                        // order type

   request.deviation=5;   

   

OrderSend(request,result);

}


\\ The above calculation has to loop over all codes included in the symbol_array string one by one for an indefinite amount of time.



Répondu

1
Développeur 1
Évaluation
(57)
Projets
72
22%
Arbitrage
13
46% / 15%
En retard
5
7%
Gratuit
2
Développeur 2
Évaluation
(58)
Projets
66
8%
Arbitrage
39
26% / 56%
En retard
12
18%
Travail
Commandes similaires
I need a clean, simple EA for MT5 that consistently produces ~5% monthly return with moderate trade frequency (6–12 trades/week). - Must auto-compound or use risk-based lot sizing - Must include .mq5 source file , not just .ex5 - Must show backtest proof on 2 different pairs , preferably M30/H1 - Must be original or legally yours to transfer, this will be used in a broader structured trading setup I’m building I
THE STUDY : Add 4 study overlay in the input settings and color bar based on alert condition is sg1=1 I want it to trail the order instead of flat to avoid too much slippage What I do is the 15-Minutes chart I have filter also in the 10tick chart if those filters are meet the bar is green or red using sierrachar color bar based on alert condition I overlay the 4 in the study in the 6tick Renko chart that will
want an aggressive scalping Expert Advisor (EA) for XAUUSD (Gold) on M1 timeframe with the following features: ✅ Uses a combination of EMA, RSI, and ATR for entry signals. ✅ Recovery Mode to increase lot size on confirmed setups to recover losses safely. ✅ Trailing Stop functionality with adjustable start and step parameters. ✅ Stop trading after daily target or daily loss limit is reached. ✅ Money Management (fixed
Hello! I've been working on a strategy that uses Ninzarenko candles from ninza.co, and while I am making incremental progress, i think I need someone to get me 100% across the finish line. This is a simple standard deviation strategy, take a look at the screenshot and see if this is something you think we can do together. Basic requirements below .. . let me know if you have any questions! Goal of the Strategy Trade
I have an account on (MT4 AxiTrader) I need some support from you I need to add a bank account on the Client Portal. Once its verify my bank account, I can submit a withdrawal. If you can do that for me then send me an offer please If you can can help how to add a bank account on the (Client Portal) please I will be very appreciate
to compile all the suitable markets for buy and place a buy for the shortest timeframe and place a sell for also a shortest timeframe it should work with all brokers and can automatically place a trade as long as its connected to the internet it should inform where the contracts are placed and for how long
i am looking for an indicator that gives buy sell signal by placing arrows on the chart, signals must not repaint or be placed with an offset, i want it to be accurate enough so i can trade from signal to signal and actually make profit, do any one have a strategy and skill to create such an indicator, and also it is to mql5, ( Important is, It must have No repainting and No offset ), if you know it is something you
The PRD: 1. Plugin ensures that individual opening positions come from MT4 to our colocated virtual machine 2. A score is returned from a lookup 3. Binary decision based on score. 4. Matches closing position with opening position; doesn't score, simply closes the trade. The plugin UX should have the following: 1. Risk threshold per grouping, easily entered by the client 2. Reporting of revenue comparisons To confirm
Mql5 indicator 30+ USD
I'm looking for an indicator that gives buy sell signals by placing arrows on the chart Signals must not repaint or be placed with an offset I want it to be accurate enough so j can trade from signal to signal amd actually make profit Do anyone have a strategy and skill to create such an indicatore First priority is to mql5
I need help listing all the studies from a chart. * I’m trying to build a scoring engine and show the score as a text message right on the chart, so I don’t have to keep checking multiple charts. Another project I’m working on—I’ve subscribed to OrderFlowLabs indicators and want to use Python to build better scoring logic. I started working on it using Claude.ai Max, but I got a bit distracted. Now, i need to

Informations sur le projet

Budget
44+ USD
Pour le développeur
39.6 USD
Délais
de 1 à 3 jour(s)