[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 363

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
Hello. I have written a simple EA (trying to learn it myself). The robot only opens trades to sell, but does not want to buy. I understand I did not spell the buy conditions correctly or did not divide them properly. I am asking for help. Here it is:
extern int tp=100;
extern int sl=100;
extern int H=14;
extern int M=00;
double ma1, ma2;
int start()
{
ma1=iMA (NULL,0,18,0,MODE_SMA,PRICE_CLOSE,0);
ma2=iMA (NULL,0,36,0,MODE_SMA,PRICE_CLOSE,0);
if (OrdersTotal ()==0 && iStochastic (NULL,0,50,30,3,0,1,MODE_MAIN,4)<iStochastic (NULL,0,50,30,3,0,1,MODE_SIGNAL,4) && ma1<ma2)
OrderSend ("EURUSD", OP_SELL,0.1,Bid,0,Ask+sl*Point,Ask-tp*Point,",123,Red);
if (OrdersTotal ()==0 && iStochastic (NULL,0,50,30,3,0,1,MODE_MAIN,4)>iStochastic (NULL,0,50,30,3,0,1,MODE_SIGNAL,4) && ma1>ma2)
OrderSend ("EURUSD", OP_BUY,0.1,Ask,0,Bid+sl*Point,Bid-tp*Point,",123,Red);
}
return (0);
Well, look - at a glance - right there on this line:
You, as in Short, add to Bid+sl for Stop-Loss and subtract from Bid-tp for Take-Profit. And on the contrary, you need to subtract SL from Bid - for a stop loss, and add TP to Bid - for a profit.
I think it should work. Try it.
And you can see how nice and easy it is to read the code, when it is inserted using SRC.
What is this button?
What does it mean to optimise? Together with the robot in the tester, optimise.
Could you tell me what '(' - incompatible types C:\Documents and Settings\User\My Documents\FxClub\TeleTRADE\experts\Constructor.mq4 (68, 39) means
relative return(errorcomment);?
I don't quite understand - was it a question or was it an answer?
I'm going to skip the first line since it's not quite clear at all.
And about the 2nd point (if it was a question) - it's swearing that the bracket type is incompatible. Probably, somewhere the bracket is round instead of square (or curly).
Good day! Please help!
I want to write a function that would return the type of position opened based on Bid prices.
If some amount of Bid prices constantly goes up - type Bcu and vice versa.
I tried it myself, but it always returns 0.
Good day! Please help!
I want to write a function that would return the type of position opened based on Bid prices.
If some amount of Bid prices constantly goes up - type Bcu and vice versa.
I tried it myself, but it always returns 0.
It used to be like this: in the tester, you tick OPTIMIZE and a window appears with all your EXTERNAL variables. you specify the min, max and step. that's it.
Now I tick the box...and nothing happens.
can you tell me where the parameter and pitch window is?
It used to be like this: in the tester, you tick OPTIMIZE and a window appears with all your EXTERNAL variables. you specify the min, max and step. that's it.
but now I tick it...and nothing happens.
can you tell me where the parameter and pitch window is?
When in the tester, go to EA settings - there are 4 columns. 1st column is what will just work without optimisation. 2nd column is initial parameters for optimisation, 3rd column is step and 4th column is end of optimisation.
I only see the EXPERT PROPERTIES in the tester. I do not see Expert Advisor settings. Where are they ?
there is nothing like that in the properties. build 500