[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
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?
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... :)
Good afternoon, my friends.
Please advise on a method to determine how many bars a position is open.
Dear friends, Good afternoon.
Please advise on a method to determine how many bars a position is open.
Good afternoon.
Does anyone know how to view account history in pips and not in currency?
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
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