[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 838

 
Mathers:

No, I'm specifically interested:

if I knowingly put the wrong price, but set a huge slippage to reach the current price - should my order be accepted or not?

Of course, there will be an error, because the current price does not correspond to the request price, which means that an error will be generated. It will not even be sent to the server by your terminal. On the other hand, when you open at current prices, your terminal will send your request to the server, and when you receive the answer from the server, that's when the slippage will matter. If you get a price different from the price in your trade order, but within your set slippage limits, then your trade order will be executed. Otherwise, it will not.
If you wish to place an order different from the current bid/ask price, you can use pending orders. The allowed value to be set there will be the size of Stop Level.

Oops... Victor has already worked it out here... :)
 
Thank you, now I understand :)
 

Good afternoon, my friends.

Please advise on a method to determine how many bars a position is open.

 
Craft:

Dear friends, Good afternoon.

Please advise on a method to determine how many bars a position is open.

In brief, you go through all the orders (orderselect and orderstotal functions), choose the necessary order, find out the opening time(orderproperty function), then paste this time into i-barshift function and this function will return you the bar number.
 

Good afternoon.

Does anyone know how to view account history in pips and not in currency?

 
vasya_vasya:
In a nutshell: you go through all the orders (orderselect and orderstotal functions), choose the required order, find out the opening time (orderproperty function), then paste that time into the i-barshift function and this function will return you the bar number.


Thank you very much, the algorithm is more or less clear. After getting the opening bar number, you need to subtract it from the current bar.

If you have a chance, please sketch the code, because I manage to make 3 mistakes in Russian, let alone in C.

 

Hello! Help me understand this.

|| news trade.mq4 |

//| Copyright © 2010, MetaQuotes Software Corp.

//| http://www.metaquotes.net |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2010, MetaQuotes Software Corp.

#property link "http://www.metaquotes.net"



extern bool In_BUYSTOP=true;

extern intProfit_buy=100;

extern int StopLoss_buy=5;

extern double Lots_buy=0.01;

//+------------------------------------------------------------------+

extern bool In_SELLSTOP =true;

extern inttern TakeProfit_sell=100;

extern int StopLoss_sell =5;

extern double Lots_sell =0.01;

//+------------------------------------------------------------------+

//| expert initialisation function |

//+------------------------------------------------------------------+

int init()

{

//----


//----

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialisation function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

int ticket;

if (Bid >iHigh(NULL,PERIOD_D1,1)

{

ticket=OrderSend(Symbol(),OP_SELLSTOP,Lots_sell,iHigh(NULL,PERIOD_D1,1),3,iHigh(NULL,PERIOD_D1,1)+StopLoss_sell*Point,iHigh(NULL,PERIOD_D1,1)-TakeProfit_sell*Point)

}

if (Ask <iLow(NULL,PERIOD_D1,1)

{

ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots_buy,iLow(NULL,PERIOD_D1,1),3,iLow(NULL,PERIOD_D1,1)-StopLoss_buy*Point,iLow(NULL,PERIOD_D1,1)+TakeProfit_buy*Point)

}

//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

return(0);

//+------------------------------------------------------------------+

After compilation, it returns '\end_of_program' - unbalanced left parenthesis

 
etroplus:

Hello! Help me out here. I can't figure out where the error is.


After compiling it gives out '\end_of_program' - unbalanced left parenthesis

and if translated, "\end_of_program' - unbalanced left parenthesis"
 
unbalanced left bracket or unbalanced left bracket
 
unbalanced left bracket or unbalanced left bracket
Reason: