[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 840

 
etroplus:

'int' - semicolon expected E:\Program Files\Broco Trader\experts\news trade.mq4 (46, 4)


int start()
//----
int ticket;

{

int ticket; { here


}
//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
return(0);
}
//+------------------------------------------------------------------+
 
vasya_vasya:

Thank you! ))))
 
ruslanr61:

Hello!

How to decipher

double g_price_196;
double gd_204;;
double gd_unused_212;
double gd_unused_220;
double g_price_228;
double g_bid_236;
double g_ask_244;
double gd_252;
double gd_260;
double gd_276;
bool gi_284;

find the author and pay him

there is nothing to decipher

 
is the decompilation wrong?
 
Craft:

Good afternoon, my friends.

Can you please suggest a method to determine how many bars a position is open.

If possible, please sketch the code, as I manage to make 3 mistakes in Russian, let alone in C.


In a hurry:

int iBarShift_Ticket(int ticket, int timeframe)
{
   OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES);
   bool exact;
   int b = iBarShift(OrderSymbol(), timeframe, OrderOpenTime(), exact);
   return(b);
}
 
ruslanr61:
is the decompilation wrong?
normal, it always decompiles this way.
 
Thank you!!!
 
vasya_vasya:
normal, it always decompiles like this.

Thank you!
 

Please advise!

Is there a function that returns the profit value of an open position in pips?

 
I have run into a problem with MRC. For example when I want to execute this code :


double OpPriceF5B = OrderClosePrice()- OrderOpenPrice();


I want to know the difference between opening price and swap price so I don't lose swap.

How do I do that?

I'm trying to calculate it like this:


for (i=1; i <=OrdersTotal();i++){
    if (OrderSelect(i-1,SELECT_BY_POS)==true){
       if (OrderType()== OP_BUY ){
          if (OrderMagicNumber() == Magic_N_F5){
             double OpPriceF5B = OrderClosePrice()- OrderOpenPrice();
          }
       } 
    } 
}

I have a lot of orders that need to be worked out differently what kind of trailing what kind of fixed objectives and set parity but I can not cope with this task because after the deal is closed and opens because of the swap, it changes the ticket number, so I can not use the ticket number to identify the position to know what to do with it.

Please advise how to deal with the fact that the swap does not put these sticks in the wheels? how to identify a trade and know that for example it has already put parity or not, etc.