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
4. Correct your TP and SL
5. Understand that == is not good to use when comparing doubles. Check for a cross instead.
7. Understand that you should check the return code of OrderSend()Start with the SL and TP on your SELL order
Then read this about function return values.Start with the SL and TP on your SELL order
Then read this about function return values.yes but what numbers should i put? I copied this from mql4 book, so what is the correct way and where do i find it?
about return values, if ordersend is a bool if i correlate it with some other bool, like put bool a= true; , and then a= ordersend... , the message goes off, but still it doesnt work.
But about sl and tp, what should i do, thanks
{
//---
double Lot=0.01;
bool cond1=false;
double ichimoku= iIchimoku(NULL,5,9,26,52,4,0); // pegar o valor do ichimoku1
bool a=true;
if(Bid==ichimoku)
{ cond1=true;}
if (cond1=true)
{a= OrderSend(Symbol(),OP_SELL,Lot,Bid,3,Bid -10 *Point,Ask+10 *Point);}
}
yes but what numbers should i put? I copied this from mql4 book, so what is the correct way and where do i find it?
Are you sure you copied it exactly?
Think it through logically:
about return values, if ordersend is a bool if i correlate it with some other bool, like put bool a= true; , and then a= ordersend... , the message goes off, but still it doesnt work.
If you are serious about wanting to learn to code MQL4, the documentation is where you will find most of your answers.
Here is the entry for OrderSend().
Does it return a bool or something else?
If the OrderSend fails, would you like to know why? Or do you prefer to guess?
Wouldn't it be great if you made a mistake with your SL, or your lot size, and your code told you what the problem was? Error codes!
It does not return a bool. It returns the ticket number if successful or -1 if it fails.
Have you read the documentation? It's there, plain to see.