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.
Ea code request: Close previous order when open new position
Hi, i would like to make request for code for when the new position is open,automatically the previous order will close.Mean i dont want to use take profit or trailling.
Example:
When order buy is open,previous order sell will close
When order sell is open,previous order buy will close
i found the code is OrderCloseBy() but i dont know exactly where to put this code
Hi, i would like to make request for code for when the new position is open,automatically the previous order will close.Mean i dont want to use take profit or trailling.
Example:
When order buy is open,previous order sell will close
When order sell is open,previous order buy will close
i found the code is OrderCloseBy() but i dont know exactly where to put this code
thanks
Problem solve
Quote:
put after OrderSend BUY
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet) ; // close position
}
put after OrderSend SELL
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet) ; // close position
}
Other code i get from ForexFactory thanks to(Fulltime247,magnumfreak)
This programmer charged me $170 to make me this EA! As for now I am doing it myself and believe to be almost there. Here is what I got so far and the message it’s givin’ me when I try to compile it:
//+------------------------------------------------------------------+
//| Salgado.mq4 |
//| salgadoguilherme@hotmail.com|
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link "salgadoguilherme@hotmail.com"
extern bool trade=true;
extern int barstocount=50;
extern double lots=0.01;
extern int slippage=3;
extern int magicnumber=816;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
This programmer charged me $170 to make me this EA! As for now I am doing it myself and believe to be almost there. Here is what I got so far and the message it’s givin’ me when I try to compile it:
Please, what am I suppose to do here?? Thanks in advance guys..
Somewhere in the code the brackets are unbalanced. Sounds like somewhere a } and a ) are missing from the code. You'll need to look through and count how many open and closed brackets there are (+1 for open and -1 for closed) that should tell you how many are missing (say a +2 count mean two right brackets '}' or vice versa). If he indented properly you should be able to figure out where to put the right } in. Happy hunting
Somewhere in the code the brackets are unbalanced. Sounds like somewhere a } and a ) are missing from the code. You'll need to look through and count how many open and closed brackets there are (+1 for open and -1 for closed) that should tell you how many are missing (say a +2 count mean two right brackets '}' or vice versa). If he indented properly you should be able to figure out where to put the right } in. Happy hunting
The
I managed to change some settings and finally I believe to be almost there! Now after the following coding it says:
'shortSL' - variable not defined
'longSL' - variable not defined
Here is what it looks like:
//+------------------------------------------------------------------+
//| Salgado.mq4 |
//| salgadoguilherme@hotmail.com|
//| |
//+------------------------------------------------------------------+
#property copyright ""
#property link "salgadoguilherme@hotmail.com"
extern bool trade=true;
extern int barstocount=50;
extern double lots=0.01;
extern int StopLoss =40;
extern int TakeProfit =10;
extern int slippage=3;
extern int magicnumber=816;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
I'm badly in need of MQL tutorials on how to code candle-type indicators such as the attached chart. Just the links to somewhere within or outside this forum will be fine. Thanks so much.