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

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
It turns out that SymbolSelect("AUDUSD", true) returns true only if AUDUSD is not in MarketWatch - i.e. when the pair is added to MarketWatch. Once the pair is in MarketWatch, subsequent calls return false.
This behavior does not match the manual of this function at all.
Something tells me you can do without SymbolSelect().
Yeah, just updated my post above
What's the other one, or should we be doing a leg up on this one already?!
Master Forex
it took me 4 months to make an owl on alpari..... nano quanto code is very fucking time consuming and not small..... and now everything is !!!!! it's a shame .... I have no idea what to do with it.
Third owl and still the same error, glad the problem is not with the code :)
Master Forex
Thanks, I will have a look!
Thanks, I'll have a look!
Not campaigning, just answering a question :)
Hello all. I started writing EAs not too long ago. I have faced a seemingly elementary problem, which I cannot solve. Please help.
The problem. On a new tick I lose the value of a variable.
Short description. Assign to some variable the return value of the OrderSend() function and exit using the return command. On the next tick the variable value becomes equal to zero.
The key element of the source code. The full source code below.
if (SAR_Prev>LastClose && SAR_Prev2<LastClose2)
{
int ticket_sell=OrderSend(Symbol(),OP_SELL,Lots,Bid,0,Ask+StopLoss*Point,Bid-TakeProfit*Point,",111,0,Red);
Alert ("Assigned value to ticket_sell variable ", ticket_sell);
return;
}
}
Alert ("Exist position = ", position_exists, "Buy order ", ticket_buy, "Sell order ", ticket_sell);
Result.
The screenshot shows that the position was successfully opened and the order ticket was memorized in the ticket_sell variable. However, the ticket_sell variable becomes zero on the next tick. And I cannot modify/delete the order on the ticket.
Hello all. I started writing EAs not too long ago. I have faced a seemingly elementary problem, which I cannot solve. Please help.
The problem. On a new tick I lose the value of a variable.
Short description. Assign to some variable the return value of the OrderSend() function and exit using the return command. On the next tick the variable value becomes equal to zero.
The key element of the source code. The full source code below.
if (SAR_Prev>LastClose && SAR_Prev2<LastClose2)
{
int ticket_sell=OrderSend(Symbol(),OP_SELL,Lots,Bid,0,Ask+StopLoss*Point,Bid-TakeProfit*Point,",111,0,Red);
Alert ("Assigned value to ticket_sell variable ", ticket_sell);
return;
}
}
Alert ("Exist position = ", position_exists, "Buy order ", ticket_buy, "Sell order ", ticket_sell);
Result.
The screenshot shows that the position was successfully opened and the order ticket was memorized in the ticket_sell variable. However, the ticket_sell variable becomes zero on the next tick. And I cannot modify/delete the order on the ticket.
To avoid losing value, we need a global variable, put its declaration outside ofOnTick() or make it static
I.e. it would go something like this: