[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 608
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
How do you think you will decide whether it is a pullback or a reversal? Or will you open two positions on every pullback? It's a bust...
First I would like it to work, and then I would like to run the EA in the tester to find the size of lim parameter.
I can't figure out why it's not working.
I can explain it :-)
I would like to make a line that changes colour depending on the trend so to speak (primitive indicator)
It seems to change but there are gaps as if he misses a bar in the calculation
what is my mistake
//--------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue // Color of the first line
#property indicator_color2 Red // colour of the second line
double Buf_0[],Buf_1[]; //open indicator arrays
//--------------------------------------------------------------------
int init() // Special function init()
{
//--------------------------------------------------------------------
SetIndexBuffer(0,Buf_0); // Assignment of an array to the buffer
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);// Line style
//--------------------------------------------------------------------
SetIndexBuffer(1,Buf_1);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
//--------------------------------------------------------------------
return;
}
//--------------------------------------------------------------------
int start()
{
int i,counted_bars;
//--------------------------------------------------------------------
Counted_bars=IndicatorCounted(); // Number of calculated bars
i=Bars-Counted_bars-1; // Index of the first one not counted
while(i>=0) // Cycle through the uncounted bars
{
double a=(High[i]+Low[i])/2;
double b=(High[i+1]+Low[i+1])/2;
if (a=>b) Buf_0[i]=a; //change or not change colour
if (a<b) Buf_1[i]=a;
i--;
}
//--------------------------------------------------------------------
return;
}
//--------------------------------------------------------------------
I'd like to get it working first, and then run the 'EA' in the tester to size the lim parameter.
Hello!!! Can you please advise how to implement this in code? I should have 3 (Total number is set separately) losing orders sl should open two buy and sell orders. The distance between them should be set in a separate variable.
That is the logic...
Can you tell me which robots work for 15 days and which do not differ in profit from Cheetah 2.5?
Please give me a link or website etc.
Thanks in advance for your time
And you hook it up to ATR. It will be dynamic and there is no need to adjust - it will depend on market volatility
Please take a look at the code, I don't understand why orders are not closed
Please take a look at the code, I can't understand why orders are not closing
interesting structure:
if (Bid>max) max=Bid;
if (Ask<min) min=Ask;
Are you sure that if the price goes up, then if ((max-Bid)>=lim*Point) will be executed?
I would do the following - in the init() section, for example, I would memorize the price when the EA starts (it may not be in the init) - and then I would dance from this price.
If you have an Expert Advisor, you would memorize the price, but as it seems you will divide your min and max by ticks and then control your orders in this corridor