[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 505
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
bar is the shift of the current bar relative to the time set in the external settings(Start_Point).
bar = ?? at the time of deleting what?
You are being rude now: there is still no problem statement, and what you have scribbled is nothing, not even pseudo-code.
And you think I sent you to the telepaths incorrectly?
bar = ?? at the moment of deleting what?
I hope that its previous value
Well, just hope it works out.
Well, you just hope it works out.
:-) Can't you just point out the mistake?
:) but to answer the question what bar=??, you can't do that?
:) but you can't answer the question what bar=??, can you do that ?
no one noticed the mistake, so once again.
Could you tell me the error in the code? thanks.
//+------------------------------------------------------------------+
//| line.mq4 |
//| |
||
//+------------------------------------------------------------------+
//--- input parameters
extern bool sell = 1; // permission to sell
extern bool buy = 1;
extern double lots = 0.1;
extern int sl = 50;
extern int tp = 150;
extern int order = 10; //
extern double bez = 15;
extern double tral_step = 15;
extern double tral_start = 10;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
string sell_stop ="ss"; //name the line manually
string buy_stop ="bs";
//buy------------------------------------------------------------------------------------------------
// find the line and place an order when price touches
if (ObjectFind (buy_stop) > 0 ) // if there is line buy_stop
if ( ObjectGet (buy_stop, OBJPROP_PRICE1=Ask )// touch the line
{
OrderSend (Symbol(),OP_BUYSTOP, lots, Ask+Point*order,3, Bid-sl*Point, Bid+tp*Point );// send order
ObjectDelete (buy_stop); // line is removed
}
return(0);
}
//+-------------------------
No one's noticed the mistake, so once again.
can you tell me the error in the code? thanks.
Here they are (there are much more errors in your code but these ones won't even make it through the compiler): . And even if you change the code to something more sane from the compiler's point of view:
If you don't know the error, it will still be theoretically wrong without prior normalization of real values before the comparison. Even worse, normalization may fail if price changes by more than one pip in one tick and your condition slips through.
It's more correct to find the crossing condition in the following way:
P.S. In MetaTrader, finding the error spot after compilation is quite easy:
1. In the "Toolbox" tab, in the "File" field, specify the line number and the number of the symbol in which the compiler has detected an error, separated by commas.
2. If you double-click on the error message in the "Description" column of the same tab, the cursor in the editor will jump to the place where the compiler detected the error.
Well this is a beginner's topic, and if I was sure what the bar was at the time of deletion, maybe the EA would work.