Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 328

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
is this correct? Will this function return the price of the last upper fractal?
Example of a fractal search
{
for (int i = 3; i<=Bars; i++)
{
if (iFractals(Symbol(),PERIOD_M5,MODE_UPPER,i) != 0) return (i);
{
double LastUpperFractalPrice = High [i];
}
}
return (LastUpperFractalPrice);
}
Will this work or not?
double GetLastUpperFractalPrice()
{
for (int i = 3; i<=Bars; i++)
{
if (iFractals(Symbol(),PERIOD_M5,MODE_UPPER,i) != 0)
{
double LastUpperFractalPrice = High [i];
}
}
return (LastUpperFractalPrice;)
}
Will this work or not?
So, for example, it will:
As you have it, it won't.
double GetLastUpperFractalPrice()
{
for (int i = 3; i<=Bars; i++)
{
if (iFractals(Symbol(),PERIOD_M5,MODE_UPPER,i) != 0) return (i);
{
double LastUpperFractalPrice = High [i];
}
}
return (LastUpperFractalPrice);
}
Will it work or not?
No. Insert the code through the SRC in the panel.
return (ХХХ) will return from the user function - what was entered there will be returned by this function - the value of ХХХ or a result of some calculations functions.
So, when a fractal is found, write return (High [i]) - you don't have to invent anything else.
Well ahead of you))
This is an elementary function of placing pending orders, the parameters are not important, but it is important to make the Expert Advisor (it can use the existing loop of pending orders) after receiving a "new price" or to search for it, or to somehow avoid placing orders at the same price. In this case, the loop of placing orders should not stop.
double Dist=10000.0;
string SMB;
double NewPrice;
int i;
int start()
{
RefreshRates();
SMB=Symbol();
{UstanOtlozh();}
}
return(0);
void UstanOtlozh()
{
double OldPrice=WindowPriceOnDropped(); // Here the script is thrown
RefreshRates();
SMB=Symbol();
{
int i=1;
while(i<=OrdersTotal())
{
if (OrderSelect(i-1,SELECT_BY_POS)==true) // if there is a
{ // Order analysis:
if (OrderSymbol()!= SMB) continue; // Not our financial instrument.
int Tip=OrderType(); // Order type
if (Tip<2) continue; // Market order
double NewPrice=OrderOpenPrice(); // Order price
{
while(NewPrice<=Ask+200*Point||NewPrice>=Ask+50*Point)
{
NewPrice=NewPrice+50*Point;
OrderSend(SMB,OP_BUYSTOP,0.01,NewPrice,3,0,0,NULL,0,CLR_NONE);
if(NewPrice>Ask+200*Point||NewPrice<Ask+50*Point)
break;
}}}}}}
I have fixed it to compile - and use 555 build of MT4 EDITOR - it really helps to find problems quickly. just read the manual before installing - the first 15 pages.
I never thought I'd be asking about such a simple thing. When compiling, I get a message that the BU() function is not involved. I put it this way (code is given) now everything compiles, but breakeven function does not work. I have seen the same Breakeven function in other EAs.
I never thought I'd be asking about such a simple thing. When compiling, I get a message that the BU() function is not involved. I put it this way (code is given) now everything compiles, but breakeven function does not work. In other EAs exactly the same breakeven function works.
The only reason is incorrect if(...) operator return; It seems you have only one - at the beginning of the program.
Gentlemen!!! What are you people confused about?
iFractals() returns the price, not the bar number of the fractal.
The only reason is an incorrect if(...) operator return; It seems you have one - at the beginning of the program.
This has been removed. But the problem lies elsewhere - in normalisation. For some reason the EA sees 4 decimal places instead of 5. How do I fix it?
How many digits does the broker have?