Have you looked at the specifications of that symbol (this is for Gold as I don't have DJ30):
Talk to your broker.
Carl Schreiber #:
thanks for your answerHave you looked at the specifications of that symbol (this is for Gold as I don't have DJ30):
Talk to your broker.
where can I find this filling menu that specifies the filling methode
also another question is can an EA work with other symbols beside FOREX?
you mentioned you are working with Gold may i ask what symbol do you use?
Select the symbol in the Market Watch => right mouse klick for the context menu => click on Specification:
hello, anyone who can help me to correct only two errors please for EA ERRORS AT NUMBER 1&2, HERE IS THE CODE: #include <MetaTrader5/MetaTrader5.mqh>
#include <string>
int OnInit()
{
// Check the program type
if(MQLInfoInteger(MQL_PROGRAM_TYPE) != PROGRAM_EXPERT)
{
Print("Error: This program is not an expert advisor.");
return(INIT_FAILED);
}
// Print account information
double balance = AccountInfoDouble(ACCOUNT_BALANCE);
double equity = AccountInfoDouble(ACCOUNT_EQUITY);
double margin = AccountInfoDouble(ACCOUNT_MARGIN);
Print("Account Balance: ", balance);
Print("Account Equity: ", equity);
Print("Account Margin: ", margin);
return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason)
{
// Add any cleanup code here
}
void OnTick()
{
// Retrieve the current market data
MqlRates curr_rates[];
int rates_count = CopyRates(Symbol(), Period(), 0, 1, curr_rates);
if(rates_count != 1)
{
Print("Error: Failed to get current market data.");
return;
}
// Implement your trading logic here
if(curr_rates[0].close > curr_rates[0].open)
{
// Buy order
MqlTradeRequest request = {};
MqlTradeResult result = {};
request.action = TRADE_ACTION_DEAL;
request.symbol = Symbol();
request.volume = 0.1;
request.type = ORDER_TYPE_BUY;
request.deviation = 5;
if(!OrderSend(request, result))
{
Print("Error: Failed to place buy order. Error code: ", GetLastError());
}
else
{
Print("Buy order placed successfully. Order ticket: ", result.order);
}
}
else
{
// Sell order
MqlTradeRequest request = {};
MqlTradeResult result = {};
request.action = TRADE_ACTION_DEAL;
request.symbol = Symbol();
request.volume = 0.1;
request.type = ORDER_TYPE_SELL;
request.deviation = 5;
if(!OrderSend(request, result))
{
Print("Error: Failed to place sell order. Error code: ", GetLastError());
}
else
{
Print("Sell order placed successfully. Order ticket: ", result.order);
}
}
}

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Subject: Issues with Order Filling Modes for DJ30 Symbol
Hello MQL5 Community,
I'm currently developing an Expert Advisor (EA) for trading the DJ30 symbol on MetaTrader 5. My EA needs to handle different order filling modes, and I want to ensure that it correctly supports the filling modes allowed for DJ30.
I've come across the following filling modes:
However, I'm experiencing issues with "unsupported filling mode" errors from my broker when trying to place orders.
Here is a snippet of my current code:
Despite this, I still encounter errors with certain brokers. Could anyone provide insights or share experiences on handling filling modes, specifically for DJ30, across different brokers? Any advice on best practices or potential code adjustments would be greatly appreciated.
Thank you in advance for your help!