
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
So why are you returning the ticket number ? Read the code you are copying and pasting, understand it, learn . . .
i used it to do the following
if(OrderSelect(LastOpenTicketForBuy(), SELECT_BY_POS)==true)
{ order for buy= OrderOpenPrice();}
then if ( (( order for buy+ order for sell)/2))<MarketInfo("EURUSD",MODE_BID) )
close the position
if(OrderSelect(LastOpenTicketForBuy(), SELECT_BY_POS)==true)
a little change with your permission
Dear qjol
thanks a lot for your real help. but still i am not sure if it will work or not ( i think my functions a little diffecult). let us see
first function :
function to get and keep the last order open price for buy only
2- function to get and keep the last order open price for sell
3- function to get and keep the last order close price whatover buy or sell
4- function to get and keep the previous close price before the last close order whatover buy or sell.
OK, try this . . .
It will do 1 & 2 . . .
LastOpenPrice(OP_BUY) for open price of last buy.
LastOpenPrice(OP_SELL) for open price of last sell.
And this . . . .
for 3 . . .
raptor
i think u missing something if he has more than 1 order on the same pair (& the same magic) therefore i think it's better this way
your opinion
raptor
i think u missing something if he has more than 1 order on the same pair (& the same magic) therefore i think it's better this way
your opinion
guys,
thanks a lot,
let me tell you why i want to use LastOpenPrice(OP_BUY) and LastOpenPrice(OP_SELL) because i want to use them in some conditions like
if ( LastOpenPrice(OP_BUY) -LastOpenPrice(OP_SELL)) > 0.0090 // for that reason i need to keep the last order was open for buy and the last order was open for sell, so i need separate last order one for buy and the other for sell.
-----
for double LastClosePrice() // can i used if ( OrderType() == OP_BUY || OP_SELL) instead *** OrderType() < OP_BUYLIMIT*** to get the last close whatover buy or sell.
----
for function number 4:
4- function to get and keep the previous close price before the last close order whatover buy or sell. // i want to get the closed order before the last closed order whatover buy or sell.
thanks