[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 481

 
sss2019:

Can you tell me why the indicator buffer shows one number, but when I output it through iCustom, it's different? I have already checked it a hundred times, the iCustom function points to this very indicator, and to this very buffer, I don't understand what the problem is.



Maybe, the indicator shows the 1st bar, and iCustom reads the 0th one, then iCustom always shows the Open[0] price. Check it.
 

Hi guys, I am looking for a script that can be placed in the active window of a pair and it will show profit or loss in pips on this pair, if anyone knows one, please let me know, I would be very grateful! Thanks in advance!

 

(I wrote a function like this, what does it count? )

double TotalProfit()
{
  double MyProfit=0;
  for(int Cnt=0;Cnt<OrdersTotal();Cnt++)
  { 
    OrderSelect(Cnt,SELECT_BY_POS,MODE_TRADES);
    if(OrderMagicNumber()==Magic)
    {
      MyProfit+=(OrderProfit()/OrderLots());
    }
  }
  return(MyProfit);
}
 
xYYx:

Hi guys, I am looking for a script that can be placed in the active window of a pair and it will show profit or loss in pips on this pair, if anyone knows one, please let me know, I would be very grateful! Thanks in advance!


Take a look at this one, I don't remember exactly.
Files:
clgj.mq4  7 kb
 
For buy orders, stops/profits are based on Bid, but for buy orders the limit is based on Ask - why?
 
rustein:

(I wrote a function like this, what does it count? )


Profit adjusted to a standard lot
 
-Aleksey-:
For buy orders, stops/profits are based on Bid, but for buy orders the limit is based on Ask - why?

Are you sure about this?
 
Vinin:

Are you sure?
Yes, I'm writing the minimum stop level feature for 409 bild now. For a buy order the tester considers the minimum values from Bid to be correct, and for a buy limit order the tester considers the minimum values from Ask to be correct.
 
Thank you, could you please tell me how to calculate the total profit in pips of all open orders? What needs to be adjusted?
 
rustein:
Thank you, please tell me how to calculate the total profit in pips of all open orders. What needs to be adjusted?

The easiest way:

Open the "Trade" tab in the terminal, right-click there and select: Profit > In pips

Reason: