Where do I start. You're trying to get into the record books. You've more errors than anything else mate.
- Variables that aren't needed.
- Trying to define something as a variable when it is a conditional statement.
- Attempting to have a variable that is both a bool and a double.
- Semicolons on the end of if statements.
- Missing parenthesis.
Without knowing what you are trying to achieve, its difficult for me. So since I've taken a guess and just tidied up the syntax errors, this may not be exactly what you need but see how you go with it.
CB
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (High[iHighest(Null,0,MODE_CLOSE,10,1)] >= High[iHighest(NULL,0,MODE_OPEN,10,1)])
{
// do stuff;
}
else
{
// do other stuff;
}
return(0);
}
Where do I start. You're trying to get into the record books. You've more errors than anything else mate.
- Variables that aren't needed.
- Trying to define something as a variable when it is a conditional statement.
- Attempting to have a variable that is both a bool and a double.
- Semicolons on the end of if statements.
- Missing parenthesis.
Without knowing what you are trying to achieve, its difficult for me. So since I've taken a guess and just tidied up the syntax errors, this may not be exactly what you need but see how you go with it.
CB
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (High[iHighest(Null,0,MODE_CLOSE,10,1)] >= High[iHighest(NULL,0,MODE_OPEN,10,1)])
{
// do stuff;
}
else
{
// do other stuff;
}
return(0);
}
Thank you CB,
That is it, in a nut shell. The code is to do stuff, else do other stuff. To Buy on the breakout of the highest 10 bars, (at the highest open or the highest close). Then to exit all positions at the lowest low of the last 5 bars. I have never had the oppurtunity to back test this system, except by doing it all long hand. Time consuming, but I am in it for the finish product. Whatever it takes. To do thrity months by long hand takes me about 2 months. Of course, you have not seen the whole system yet. But that is only because I have not yet mastered the basics. I stumbled upon this site and the sky is the limit. This quest is not only for me, but for the community. Thank you for helping. I want very much to learn this lanugage but feel I have not moved an inch yet. This code is version 12 and yet I did not come close to coding it correctly. And this part of the code is only step 1 of a flow chart that keeps growing. So far it is 17 steps. Do not get me wrong, I am in it for the finish. Thanks again. The thanks also go to Tim, robofx.org, and Niko.
Now that you have helped me get pass that first step, I am going to code the next step and add it onto step one.
Regards to you all,
Huckleberry
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good Morning from California,
Been tearing this problem apart and just digging a bigger hole.
Can someone have look please, 29 errors, but looks like I am have prolems understanding
the declarations, as well as the code.
Thanks in advance,
Huckleberry
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net/"
Compares, then accepts highest value (a>=b) or (b>a)
extern bool (a>=b)==true;
extern bool (b>a)==true;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
if (a>=b);
{
//This condition is (a>=b)
if
bool double high=High[iHighest,Null,0,MODE_CLOSE,10,1)];
>=;
bool double high=High[iHighest,NULL,0,MODE_OPEN,10,1)];
{
else //Where as, this condition is (b>a)
bool double high=High[iHighest,NULL,MODE_OPEN,10,1)];
>;
bool double high=High[iHighest,NULL,MODE_CLOSE,10,1)];
return(0);
}
}