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

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
I'm still stumped and don't get it, I don't understand where the unique sequence number comes from, everything is different in the examples,
if I'm not mistaken I don't create it, for example
The ticket (order) number is given by the brokerage company.
I'm still stumped and don't get it, I don't understand where the unique sequence number comes from, everything is different in the examples,
if I'm not mistaken, I don't create it, for example
It's not me who creates it, it's the DC who assigns it. Does it matter to you that much where exactly it comes from and why?
The main thing is that it exists and you can use it to select your order. But do not forget about the situation when at the end of the day the orders are re-opened with the assignment of a new ticket. So, if you don't know about it and don't take it into account, you may lose it when choosing a position by the ticket.
The DC assigns it to him. Does it matter that much to you where it comes from and why?
The main thing is that it is there and you can use it to select your order. But do not forget about the situation when at the end of the day the orders are re-opened and a new ticket is assigned. So, if you do not know about it and do not take it into account, you may lose it when choosing a position by the ticket.
Well, let's say I don't need to know where it is coming from, then "The main thing is that it exists and you can use it to select your order.
Here, the deposit is in place.
You have to look at the rules of the brokerage company. Maybe autotrading is forbidden (although the rules may not say so), you should check with the technical support. Or maybe you just need to check the Expert Advisor code. Check it on another brokerage company
OK, let's say I don't need to know where it comes from, then "The important thing is that it is there and you can use it to select your order", how can I select it if I don't even know the number?
Here it is
//+------------------------------------------------------------------+
//| Dimon's Borders .mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
extern int BandsPeriod=20,i=1 ;extern int BandsShift=0;
extern double BandsDeviations=2.0;
extern double Lots=0.1,TakeProfit=50,stoploss=10 ;double PointX;
int init()
{ if(Digits==5 || Digits==3) PointX = Point * 10; // Correction Point for three or five digits
if(Digits==4 || Digits==2) PointX = Point;
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ int total=OrdersTotal();// Comment(" total ",total); Alert (" total ",total);
if ( total !=0 ){return;}
double Average,Verhnyayaghranytsa,Nyzhnyayaghranytsa,newres,sum,deviation;
string text; int ticket; int err;
text="macd sample";
Average=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
int k,counted_bars=IndicatorCounted();
//----
//----
for( k = 0; k<BandsPeriod; k++)
{ newres=Close[k]-Average;//Alert (" Average ",Average);
sum+=((newres*100)*(newres*100))/10000;//Alert (" newres ",newres);
}
deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
Verhnyayaghranytsa=Average+deviation;
Nyzhnyayaghranytsa=Average-deviation;//Alert (" sum ",sum);
// Alert (" deviation ",deviation);
//----
if (Verhnyayaghranytsa<Close[i])
{ Comment(" buoy ",Verhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*PointX,Ask+TakeProfit*PointX, "macd sample",16384,0,Green);
}
if (Nyzhnyayaghranytsa>Close[i])
{ Comment(" sell! ",Nyzhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*PointX,Bid-TakeProfit*PointX, "macd sample",16384,0,Red);
Alert (GetLastError());
}
return(0);
}
//+------------------------------------------------------------------+