You got it backwards. Rule for using functions:
Wrong:
function() = variable;
right:
variable = function();
thank phy
yes, I have to put a variable
symbol()="gbpusd";
ticket=OrderSend(eurusd,OP_BUY,Lots,Ask,2,SL,TP);
but could you tell me what happen in this case?
The first line fix currency trade to "gbpusd" indead?
but the second line apply eurusd to the order?
it is possible without conflict?
thanks in advance
thank phy,
But how do you use this function?
I don`t understand.
if ( OrderSymbol()==Symbol())
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,TP);
What is the meaning of theses lines?
where the currency pair is put?
thanks in advance
if ( OrderSymbol()==Symbol()) ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,TP);
If the pair in the previously selected order is equal to the pair on the chart, send an order to sell the charted pair.No.
string Symbol( | ) |
Please read Documentation.
Put this in your code right after the start() function:
int start(){
Comment(" The current financial instrument is ", Symbol()); // <-------add this
.
view the result at the top left of your chart.
Ok, I understand, symbol() return the pair of the chart
and OrderSymbol() return the pair chosed on last OrderSend
indead?
![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
dear every one,
I don`t understand how work function symbol()
what hapen in this case?
symbol()=gbpusd;
ticket=OrderSend(eurusd,OP_BUY,Lots,Ask,2,SL,TP);
The first line select gbpusd currency indead?
And the order will be sent with eurusd ?
thanks in advance