[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 392 1...385386387388389390391392393394395396397398399...537 New comment ilunga 2011.05.18 13:26 #3911 Dimka-novitsek: Use SRC to insert programme text, impossible to read How do you use it? I don't know what it is at all. Read the F.A.Q., it explains everything in detail https://forum.mql4.com/ru/38943/page2#463875 ilunga 2011.05.18 13:28 #3912 T-G: I understand this, I even understand how to find the last one, but I can't find the last and penultimate one. first find the last bar from 0 in the loop, remember its number as N1 And then go in the loop from (N1+1)-th bar and find the next one [Deleted] 2011.05.18 13:30 #3913 Is it possible for the Expert Advisor to set S/L and T/P, and will this be displayed in the S/L and T/P columns of the report? Dimka-novitsek 2011.05.18 13:43 #3914 How do I follow the link? I mean, where should I put it and what should I click next? Victor Nikolaev 2011.05.18 14:01 #3915 Dimka-novitsek: How do I follow the link? I mean, where should I put it and what should I click next? The link is Dimka-novitsek 2011.05.18 14:10 #3916 I'll put the code in now. There's an error there, by the way, on a completely flat spot. And there's a table. How do you put the code into it? Dimka-novitsek 2011.05.18 14:12 #3917 //+------------------------------------------------------------------+ //| for avalanches.mq4 | //| Copyright © 2011, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" extern double stoploss=0; extern double takeprofit=20; extern int otstup=20; extern datetime expiration=0; //+------------------------------------------------------------------+ //| expert initialisation function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialisation function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int tiket,tikett;double volume=0.1;int i=0,R1=0,R2=0,A=1 ;double price=PRICE_OPEN; // R1=((PRICE_OPEN- stoploss*Point)*stoploss)/stoploss;R2=((PRICE_OPEN+ stoploss*Point)*stoploss)/stoploss; int start() { int X; //---- for(int Uy=OrdersTotal();Uy<=-1;Uy--){ OrderSelect((Uy,SELECT_BY_POS ); if(OrderSymbol()==Symbol()&&OrderMagicNumber( )==1000||OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol()) {X=X++;}} if (X>=2){ tiket= OrderSend( Symbol(), OP_BUYSTOP, volume*A, price+otstup*Point, Point* 3, R1, PRICE_OPEN+takeprofit*Point+otstup, "OP_BUYSTOP", 1000, expiration, Red); Alert ("OP_BUYSTOP", GetLastError( ); tikett= OrderSend( Symbol(), OP_SELLSTOP, volume*A, price -otstup*Point, Point* 3,R2, PRICE_OPEN-takeprofit*Point-otstup, "OP_SELLSTOP", 2000, expiration,C'0,128,255' ); Alert ("OP_SELLSTOP", GetLastError( ); } //---- return(0); } //+------------------------------------------------------------------+ [WARNING CLOSED!] Any newbie [ARCHIVE] Any rookie question, OrderSend at a certain Dimka-novitsek 2011.05.18 14:14 #3918 It's not coloured. --- 2011.05.18 14:14 #3919 Dimka-novitsek: I'll put the code in now. There's an error there, by the way, on a completely flat spot. And there's a table. How do you put the code into it? What table? You press the right button. Dimka-novitsek 2011.05.18 14:16 #3920 Well, I press the SRC, the table appears. 1...385386387388389390391392393394395396397398399...537 New comment
Use SRC to insert programme text, impossible to read
How do you use it? I don't know what it is at all.
Read the F.A.Q., it explains everything in detail
https://forum.mql4.com/ru/38943/page2#463875
I understand this, I even understand how to find the last one, but I can't find the last and penultimate one.
first find the last bar from 0 in the loop, remember its number as N1
And then go in the loop from (N1+1)-th bar and find the next one
How do I follow the link? I mean, where should I put it and what should I click next?
The link is
//+------------------------------------------------------------------+
//| for avalanches.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
extern double stoploss=0; extern double takeprofit=20; extern int otstup=20; extern datetime expiration=0;
//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int tiket,tikett;double volume=0.1;int i=0,R1=0,R2=0,A=1 ;double price=PRICE_OPEN;
// R1=((PRICE_OPEN- stoploss*Point)*stoploss)/stoploss;R2=((PRICE_OPEN+ stoploss*Point)*stoploss)/stoploss;
int start()
{ int X;
//----
for(int Uy=OrdersTotal();Uy<=-1;Uy--){
OrderSelect((Uy,SELECT_BY_POS );
if(OrderSymbol()==Symbol()&&OrderMagicNumber( )==1000||OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol())
{X=X++;}}
if (X>=2){
tiket= OrderSend( Symbol(), OP_BUYSTOP, volume*A, price+otstup*Point, Point* 3, R1, PRICE_OPEN+takeprofit*Point+otstup, "OP_BUYSTOP", 1000, expiration, Red);
Alert ("OP_BUYSTOP", GetLastError( );
tikett= OrderSend( Symbol(), OP_SELLSTOP, volume*A, price -otstup*Point, Point* 3,R2, PRICE_OPEN-takeprofit*Point-otstup, "OP_SELLSTOP", 2000, expiration,C'0,128,255' );
Alert ("OP_SELLSTOP", GetLastError( );
}
//----
return(0);
}
//+------------------------------------------------------------------+
I'll put the code in now. There's an error there, by the way, on a completely flat spot. And there's a table. How do you put the code into it?
What table? You press the right button.