MQL4 for Omega Trade Station user Question?

 

Hello


I'm trying to implement system from TradeStation to MetaTrader.

I don't know how to implement 'BarsSinceEntry' function in mql4.


Mirek (PL)

 
miso:

Hello


I'm trying to implement system from TradeStation to MetaTrader.

I don't know how to implement 'BarsSinceEntry' function in mql4.


Mirek (PL)

You would have to add the current bar in the comment of the ordersend() function. At a later bar, you compare the current bar to the bar that is in the comment of the order, and the difference is your "BarsSinceEntry".

 

OrderSelect(ticket, ..., ... );

int BarsSinceEntry = iBarShift(OrderSymbol(), Period(), OrderOpenTime());

 
c0d3:

You would have to add the current bar in the comment of the ordersend() function. At a later bar, you compare the current bar to the bar that is in the comment of the order, and the difference is your "BarsSinceEntry".

I understand.

Thanks fo help

 
phy:

OrderSelect(ticket, ..., ... );

int BarsSinceEntry = iBarShift(OrderSymbol(), Period(), OrderOpenTime());

I understand this too.

Thanks for help
Reason: