Regarding the EA modification, how to modify the pending order for immediate execution?
f_prof_loss();
if(ExistOrder==false)
{
for(int i=0;i<count_symbol;i++)
{
// Alert(msimbol[i]);
string Symb=msimbol[i];
if(step1[i]==false && !closeallpos)
{
if(m_price[0]==0)
{
if(m_line[0]=="buy")
{
Pending_Order[i]=MarketInfoMQL4(Symb,MODE_ASK);
if(f_PositionOpen(Symb,OP_BUY,m_lot[0],Pending_Order[i],0,0,mComment))
{
step1[i]=true;
time_start=TimeCurrent();
}
}
if(m_line[0]=="sell")
{
Pending_Order[i]=MarketInfoMQL4(Symb,MODE_BID);
if(f_PositionOpen(Symb,OP_SELL,m_lot[0],Pending_Order[i],0,0,mComment))
{
step1[i]=true;
time_start=TimeCurrent();
}
}
}else{
if(ordergetstr(msimbol[i])==0)
{
if(m_line[0]=="buy")
{
Pending_Order[i]=MarketInfoMQL4(msimbol[i],MODE_ASK);
if(f_OrderOpen(msimbol[i],OP_BUYLIMIT,m_lot[0],0,Pending_Order[i]+m_price[0],0,0,0,0,mComment))
{
step1[i]=true;
time_start=TimeCurrent();
}
}
if(m_line[0]=="sell")
{
Pending_Order[i]=MarketInfoMQL4(msimbol[i],MODE_BID);
if(f_OrderOpen(msimbol[i],OP_SELLLIMIT,m_lot[0],0,Pending_Order[i]+m_price[0],0,0,0,0,mComment))
{
step1[i]=true;
time_start=TimeCurrent();
}
}
}
}
}
if(step2[i]==false && step1[i]==true)
{
if(ordergetstr(msimbol[i])==0)
{
if(m_line[1]=="buy")
{
if(f_OrderOpen(msimbol[i],OP_BUYLIMIT,m_lot[1],0,Pending_Order[i]+m_price[1],0,0,0,0,mComment))
{
step2[i]=true;
}
}
if(m_line[1]=="sell")
{
if(f_OrderOpen(msimbol[i],OP_SELLLIMIT,m_lot[1],0,Pending_Order[i]+m_price[1],0,0,0,0,mComment))
{
step2[i]=true;
}
}
}
}
how to modify the code?
Hon Yin Shum:
how to modify the code?
how to modify the code?
When posting code use Alt+S
use Meta editor and modify your code
step 1 is instant order buy step 2 is pending order buy I want modify step 2 pending to instant order, who can help me?
Hon Yin Shum:
step 1 is instant order buy step 2 is pending order buy I want modify step 2 pending to instant order, who can help me?
Please edit your post #1 as Kenneth has shown in the post above yours.
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