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

 
Please look at the code on the picture to see if anything is wrong.
 
Dimka-novitsek:
I.e., the difference is only for open orders, because the realised profit is the difference between the two prices including swaps and commissions?

Profit on an order = number of pips * pip price of the instrument at the given volume.
 
Dimka-novitsek:


Do I understand correctly that OrderProfit( ) can be negative?



Yes, it can. Then it turns into a loss on the order if the order is not closed, but the loss is floating.
 
Dimka-novitsek:
Please look at the code on the picture to see if anything is wrong.

Read ithere.
 
smartemiy:

invalid price 0.00014423 for OrderSend function

what is this ?????????


Incorrect price for OrderSend() - opening an order.

1. Calculate the price correctly.

2. When placing orders - do not forget to use

double NormalizeDouble( double value, int digits) 
Округление числа с плавающей запятой до указанной точности.
Рассчитываемые значения StopLoss, TakeProfit, а также значения цены открытия отложенных ордеров должны быть нормализованы с точностью, значение которой хранится в предопределенной переменной Digits. 

3. In addition, check these parameters to make sure they are necessary and sufficient when (before) placing any type of order.

 
Roman.:

Profit on an order = number of pips * pip price of the instrument at the given volume.

Yes, I was totally wrong there, sorry, thank you!
 
Dimka-novitsek:

Yeah, I totally missed it, sorry, thanks!


It's alright! :-))) You share a computer with your brother... :-))

Please do get in touch with questions - they will help.

Please.

 
Roman.:


Wrong price for the OrderSend() function - opening of an order.

1. Calculate the price correctly.

2. When placing orders - do not forget to use

3. Also check these parameters to make sure they are necessary and sufficient when (before) placing a certain type of order.

OK
I'll give it a try!!!

thanks a lot!

 
Roman.:

Read ithere.

Thank you! But I read it in the Metatrader_editor's help, although it's not as detailed. I also took double OrderProfit() from it. I began to test it - it's zero! And I selected it this way.
if (OrderSelect(j, SELECT_BY_POS, MODE_HISTORY))
Well, I'll think it over and if it fails, I'll ask you.
 
MaxZ:

I've never understood why People are too lazy to think... :((

Because you see, no matter how many orders are open and what orders these are, when the price changes by one pip, the total profit on orders changes by a discrete step (except for floating spread, then this step is floating) !!!!!!!!!!!!!!!!. When the step*pip is > your current loss, then your profit will come to you !!!!!!!!!!!!

When you run it on a real account "step*pip > current loss, then the profit will come to you" you see how your profit becomes a fixed minus ... Because of the broker's work ... I didn't set the take for nothing, because the profit has already been verified ..........