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

 
Vinin:



Thanks because I'm already exhausted :)))))
 

The indicator does not show past values. Help and correct.

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 SteelBlue
#property indicator_color2 SteelBlue
#property indicator_color3 SteelBlue
#property indicator_color4 SteelBlue
#property indicator_color5 SteelBlue
extern int takeprofit1=20;
extern int takeprofit2=30;
extern int takeprofit3=40;
extern int stoploss=40;
double BuyBuffer[];
double BuyTP1Buffer[];
double BuyTP2Buffer[];
double BuyTP3Buffer[];
double BuySLBuffer[];
int init()
{
 SetIndexBuffer(0,BuyBuffer);
 SetIndexBuffer(1,BuyTP1Buffer);
 SetIndexBuffer(2,BuyTP2Buffer);
 SetIndexBuffer(3,BuyTP3Buffer);
 SetIndexBuffer(4,BuySLBuffer);
 SetIndexStyle(0,DRAW_ARROW);
 SetIndexStyle(1,DRAW_ARROW);
 SetIndexStyle(2,DRAW_ARROW);
 SetIndexStyle(3,DRAW_ARROW);
 SetIndexStyle(4,DRAW_ARROW);
 SetIndexArrow(0,159);
 SetIndexArrow(1,252);
 SetIndexArrow(2,252);
 SetIndexArrow(3,252);
 SetIndexArrow(4,251);
 SetIndexLabel(0,"Buy");
 SetIndexLabel(1,"Buy TP1");
 SetIndexLabel(2,"Buy TP2");
 SetIndexLabel(3,"Buy TP3");
 SetIndexLabel(4,"Buy SL");
 return(0);
}
int start()
{
 int limit;
 int counted_bars=IndicatorCounted();
 if(counted_bars>0) counted_bars--;
 limit=Bars-counted_bars;
 for(int i=0; i<limit; i++)
 double macd1=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i+1);
 double macd2=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i+2);
 double stochmain=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,i+1);
 double stochsig=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,i+1);
 double rsi=iRSI(NULL,0,12,PRICE_CLOSE,i+1);
 {
  if(macd1>macd2&&stochmain>stochsig&&rsi<70.0)
   {
    BuyBuffer[i+1]=High[i+1]+1*Point;
    BuyTP1Buffer[i+1]=High[i+1]+(takeprofit1+1)*Point;
    BuyTP2Buffer[i+1]=High[i+1]+(takeprofit2+1)*Point;
    BuyTP3Buffer[i+1]=High[i+1]+(takeprofit3+1)*Point;
    BuySLBuffer[i+1]=High[i+1]-(stoploss-1)*Point;
   }
 }
 return(0);
}
 

Programmers. Help me write an indicator to send me email if candle's body is over 50runts. I got help yesterday, but I tried it and it did not send the signal right( I need it to send a signal once the candlestick is > 50 pips and once it closes, only 1 time and that's it...

static int prevtime = 0;

int start() {

if (Time[0] == prevtime) {
return(0);
}


if ((High[0] - Low[0]) > (50.0 * Point)) {
SendMail("???? ?????? ????? ??????", "????? ?????? 50 ??????");
prevtime = Time[0];
}

return(0);
}

please help me with this error

 

I am writing an Expert Advisor to work on Range Bars (implemented as a looped script). However, it makes a trade and is immediately removed from the chart.

The problem is obviously in return(0), but how do I get around it? I am attaching the scripts below. They differ only in the algorithm of looping.

http://dl.dropbox.com/u/47506458/RB4 sctipt2 .mq4

http://dl.dropbox.com/u/47506458/RB4 script3.mq4

/* edited by the moderator, please insert links correctly */

 
alkador:

I am writing an Expert Advisor to work on Range Bars (implemented as a looped script). However, it makes a trade and is immediately removed from the chart.

The problem is obviously in return(0), but how do I get around it? I am attaching the scripts below. They differ only in the algorithm of looping.

http://dl.dropbox.com/u/47506458/RB4 sctipt2 .mq4

http://dl.dropbox.com/u/47506458/RB4 script3.mq4


I don't even want to look, but what's stopping the script from being moved to the experts folder and not suffering from perversion?
 
Hello. I am new to MT4. I have a question: Can I place several orders at the same time using an EA or a script? For example, to place 10 orders with the same parameters.
 
globad:
Hello. I am new to MT4. I have a question: Can I place several orders at the same time using an EA or a script? For instance, I want to place 10 orders with the same parameters.
Only in the tester. This is also theoretically possible on a demo or real account, but only from 10 different terminals. The reason is that the server closes (declares busy) a trade thread for other orders while processing each order and we have to wait until this very thread becomes free.
 
globad:
Hello. I am new to MT4. I have a question: Can I place several orders at the same time using an EA or a script? Let's say, you may place 10 orders with the same parameters.
Yes, search for: Grid, Grider,
 
Reshetov:
Only in the tester.
I think the tester is good, but I need a real one.)) So, the orders will be opened one after the other anyway?
 
rustein:
Yes, search for: Grid, Grider,
i understand they just place orders at regular intervals. i need to place all orders at the same price with pp and slots the same. at the same time i want to be able to place orders simultaneously and not one after another.
Reason: