Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
Hi,
I've been trying to make an EA that will test to see what currency pairs have active trades and if there are none, to open a hedge. Here's the code I'm trying. I realize each time it only selects the first trade and returns only that particular currency. So how do I get it to return all currency pairs that have open orders?
Code:
OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
{
int trade;
int trades=OrdersTotal();
for(trade=0;trade<trades;trade++)
{
if (OrderSymbol()=="EURUSDm")
{
Symbol_0=true;
}
if (OrderSymbol()=="GBPUSDm")
{
Symbol_1=true;
}
}
}
if (Symbol_0==true)
{
RefreshRates();
int ticket_buyEUR;
ticket_buyEUR=OrderSend("EURUSDm",OP_BUY,Lots,MarketInfo("EURUSDm",MODE_ASK),3,0,0,"",1234567,0);
int ticket_sellEUR;
ticket_sellEUR=OrderSend("EURUSDm",OP_SELL,Lots,MarketInfo("EURUSDm",MODE_BID),3,0,0,"",1234567,0);
}
if (Symbol_1==true)
{
RefreshRates();
int ticket_buyGBP;
ticket_buyGBP=OrderSend("GBPUSDm",OP_BUY,Lots,MarketInfo("GBPUSDm",MODE_ASK),3,0,0,"",1234567,0);
int ticket_sellGBP;
ticket_sellGBP=OrderSend("GBPUSDm",OP_SELL,Lots,MarketInfo("GBPUSDm",MODE_BID),3,0,0,"",1234567,0);
}
What can I do if I have 2 lots. My first 1st lot is 10 pips and the 2nd lots is 20pips. After the 1st profit I would like to shift the SL of my 2nd lot further by another 10 pips (so as to protect my position of the 2nd lot)!
Shall I use the "OrderModify" command to amend the current trade order. If yes, how will be the code like? Can show me?
I hope my description is clear and may someone just code a few line so that I may proceed with the EA program.
I would appreciate and thankful for any comments given.
I've got a quick question. My broker, IBFX, recently sent this to me...
"If you compiled an Expert Advisor or a Script in build 213, MetaTrader has informed us that you will have to recompile it once you update to Build 214/215.
To recompile go to:
Tools
MetaQuotes Language Editor (F4)
Double left click your Expert Advisor or Script in the Navigator
Left click on the Compile button
Exit MetaQuotes Language Editor"
My question is, what does recompiling do to an EA/script?
Thanks
__________________ http://www.EAprogrammers.com/ - A free resource devoted to connecting successful forex traders with professional programmers.
I've got a quick question. My broker, IBFX, recently sent this to me...
"If you compiled an Expert Advisor or a Script in build 213, MetaTrader has informed us that you will have to recompile it once you update to Build 214/215.
To recompile go to:
Tools
MetaQuotes Language Editor (F4)
Double left click your Expert Advisor or Script in the Navigator
Left click on the Compile button
Exit MetaQuotes Language Editor"
My question is, what does recompiling do to an EA/script?