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.
I`m newbie on forex market. I`m trying to build my own EA, and I succeed but i have few question about some features...
I trade on 5 different currency pairs: EURUSD, AUDUSD, USDCAD, USDJPY and NZDUSD...on H1 timeframe.
I want to implement some new features in EA, for example when EA open long trade on one currency pair and that trade goes to -50pips that my EA open another long trade on the same pair.
And, if possible to code that they both close when I have cumulative profit...maybe first one is -20 pips, but the second is +30 and to close immediatelly both (so I have +10 pips profit).
please someone can explain me why this code dosen't work correctly
instead drawing 8 MA on chart it draws only first two i.e 5 and 8 periods moving averages
#property indicator_chart_window // Indicator is drawn in the main window
#property indicator_buffers 8 // Number of buffers
#property indicator_color1 Lime // Color of the 1st line
#property indicator_color2 Blue // Color of the 2nd line
#property indicator_color3 Red
#property indicator_color4 SeaGreen
#property indicator_color5 MediumVioletRed
#property indicator_color6 DeepSkyBlue
#property indicator_color7 OrangeRed
#property indicator_color8 Orange
extern int Aver5=5; // number of bars for calculation
extern int Aver8=8; // number of bars for calculation
extern int Aver21=21; // number of bars for calculation
extern int Aver55=55; // number of bars for calculation
extern int Aver89=89; // number of bars for calculation
extern int Aver144=144; // number of bars for calculation
extern int Aver233=233; // number of bars for calculation
extern int Aver377=377; // number of bars for calculation
double Buf_5[],Buf_8[],
Buf_21[],Buf_55[],
Buf_89[],Buf_144[],
Buf_233[],Buf_377[]; // Declaring indicator arrays
//--------------------------------------------------------------------
int init() // Special function init()
{
//--------------------------------------------------------------------
SetIndexBuffer(0,Buf_5); // Assigning an array to a buffer
SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(0,0);
//--------------------------------------------------------------------
SetIndexBuffer(1,Buf_8); // Assigning an array to a buffer
SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(1,0);
//--------------------------------------------------------------------
SetIndexBuffer(2,Buf_21); // Assigning an array to a buffer
SetIndexStyle (2,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(2,0);
//--------------------------------------------------------------------
SetIndexBuffer(3,Buf_55); // Assigning an array to a buffer
SetIndexStyle (3,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(3,0);
//--------------------------------------------------------------------
SetIndexBuffer(4,Buf_89); // Assigning an array to a buffer
SetIndexStyle (4,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(4,0);
//--------------------------------------------------------------------
SetIndexBuffer(5,Buf_144); // Assigning an array to a buffer
SetIndexStyle (5,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(5,0);
//--------------------------------------------------------------------
SetIndexBuffer(6,Buf_233); // Assigning an array to a buffer
SetIndexStyle (6,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(6,0);
//--------------------------------------------------------------------
SetIndexBuffer(7,Buf_377); // Assigning an array to a buffer
SetIndexStyle (7,DRAW_LINE,STYLE_SOLID,1);// Line style
SetIndexShift(7,0);
//--------------------------------------------------------------------
return;
}
//--------------------------------------------------------------------
int start()
{
ma(Aver5,Buf_5);
ma(Aver8,Buf_8);
ma(Aver21,Buf_21);
ma(Aver55,Buf_55);
ma(Aver89,Buf_89);
ma(Aver144,Buf_144);
ma(Aver233,Buf_233);
ma(Aver377,Buf_377);
void ma(int& average,double& buffer[])
{
int n,i;
int Counted_bars;
double Sum;
Counted_bars=IndicatorCounted(); // Number of counted bars
i=Bars-Counted_bars-1; // Index of the first uncounted
while(i>=0) // Loop for uncounted bars
{
Sum=0; // Nulling at loop beginning
for(n=i;n<=i+average-1;n++) // Loop of summing values
{
Sum=Sum + Close[n]; // Accumulating maximal values sum
}
buffer[i]=Sum/average; // Value of buffer on i bar
i--; // Calculating index of the next bar
}
}
Hello, I'm using a MoveStopOnce with SL slide and Trailing Stop technique and was wondering why it wasn't triggering until way past my set BE level.
I was using settings of for example when price gets to +21, move SL to BE+19 then Trail every 3 pips after that. The issue was that BEslide didn't trigger first SL move until price got to +28 pips then I realized my broker for USH/CHF has a MODE_STOPLEVEL of 8 so hence the reason why BE wasn't getting triggered at my set amount of +21 pips, it wasn't allowing the SL being moved so close to price.
Is there anyway around that? or is it just that the Broker will not allow SL within MODE_STOPLEVEL of price no matter what Technique I use?
I guess I could somehow monitor the SL moves internally within the EA and not physically move the SL then when price drops to where it would have hit SL if BE and Trail was actually working then close the trade at that point ??
I'm just not that good of coder
is there a way to create global crosshairs in mt4? have several different tf up and would like to scroll through one tf while seeing position on others. have looked on net..found .mq4 from forex fac but could not get to work.
I have coded an EA but I want to limit the amount of open orders it has in each instance it is running, for example, if the EA is running on the USDJPY and EURUSD, how can I keep it to having a maximum of 3 orders open for each pair. I tried using orderstotal() but that gives me all the open orders for the account, and I want to be able to trade manually around the EAs. Anyone have some pseudo-code or ideas about how to implement this?