[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 38

 
evillive:

Well then, here is https://www.mql5.com/ru/forum/106619

Windows Task Scheduler, allows you to do things like send mail, run apps/scripts/buttons, etc. on a schedule or by signal.

Thanks, I'll give it a try. I hope my script will be useful to someone too. Now I wish I could create a virtual file in memory instead of a real one and run it, and then everything would be in the EA... Although, this is an extravagance...
 
There is also the EXP_Relogin advisor .
 
Good afternoon. Can you tell me how to optimise an EA for trading on a cent account?
 

Good morning!

Can you tell me how to check the opening and closing of a market order?

Thank you.

 
Good afternoon everyone!
The question is as follows, the first time the indicator is started it is displayed
by alphabra-cadabra (pic.1). After further scrolling on the history all is normal (fig.2).

Can you tell me what's the problem? Below if you need the code.

#property indicator_separate_window
#property  indicator_buffers 3
#property  indicator_color1  Tomato
#property  indicator_color2  Red
#property  indicator_color3  Blue
#property indicator_level1 0
#property indicator_levelcolor Gray
#property indicator_levelstyle 2

extern int Period_MA = 5;
extern int MA_Line1 = 13;
extern int MA_Line2 = 34;
 
double Brs[],BrsMA1[],BrsMA2[],MathArr[],MathArr1;
int i=0,j=0;
double hvostUp,hvostDn,rast,S;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,Brs);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(1,BrsMA1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(2,BrsMA2);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexLabel(0,"Bars_");
   SetIndexLabel(1,"Bars_MA1");
   SetIndexLabel(2,"Bars_MA2");
     
   ArrayResize(MathArr,Period_MA);
   
 //---- name for DataWindow and indicator subwindow label
   IndicatorShortName("Bars_MA");

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit(){return(0);}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start() {  

int ncount=IndicatorCounted();
int limit=Bars-ncount-1;

for (int i=0; i<limit; i++)
{

if (High[i+2]>High[i+1] && Low[i+2]>Low[i+1])
{
hvostUp=(High[i+2]-High[i+1])/Point;
hvostDn=(Low[i+2]-Low[i+1])/Point;
rast=(High[i+2]-Low[i+1])/Point;
S=rast-hvostUp-hvostDn;
}

if (High[i+2]<High[i+1] && Low[i+2]<Low[i+1])
{
hvostUp=(MathAbs(High[i+2]-High[i+1]))/Point;
hvostDn=(MathAbs(Low[i+2]-Low[i+1]))/Point;
rast=(High[i+1]-Low[i+2])/Point;
S=rast-hvostUp-hvostDn;
}

if (High[i+2]>=High[i+1] && Low[i+2]<=Low[i+1])
{
S=(High[i+1]-Low[i+1])/Point;
rast=(High[i+2]-Low[i+2])/Point;
}

if (High[i+2]<=High[i+1] && Low[i+2]>=Low[i+1])
{
S=(High[i+2]-Low[i+2])/Point;
rast=(High[i+1]-Low[i+1])/Point;
}

if (High[i+2]<=Low[i+1] || Low[i+2]>=High[i+1])
{
S=0;
rast=1;
}

if(j>=Period_MA-1)j=0;
j++;
 MathArr[j]=(S/rast*100);
 
Brs[i]=iMAOnArray(MathArr,0,Period_MA,0,0,0);
BrsMA1[i]=iMAOnArray(Brs,0,MA_Line1,0,0,0);
BrsMA2[i]=iMAOnArray(Brs,0,MA_Line2,0,0,0);
}   
  return(0);
}

Fig.1

Fig. 2

Files:
bars_ma.mq4  4 kb
 
I would like to share my thoughts with you. Reading various forex forums I see that nasty things happen on the part of brokerage companies when trading live. I have not seen anything bad happen with demo accounts. I have an idea: put EA on demo and connect it with my real account and then connect it with my demo account (through ). Of course a few pips from deal will be lost but for strategies with more than 10 pips it is good enough plus possibility for someone else to sign using .
 
Someone tell me how to rewrite the script! When placing orders, the script is guided by the current Bid price, while the Open price is needed.
 
It would be nice to automate this process, i.e. to do this job beforehand instead of waiting for profit to trigger. i looked through all of the posted scripts, i found a similar one, but they say it doesn't work. it' s for clarity. Or let's make a function that when a TP or SL triggers, the script opens all just closed orders, only in a pending form. Many traders know what they are going to do in a certain situation and it's very convenient to do that before the situation happens.
 

Could you please help me? How to close 5 pending orders with the same magic.

Thanks in advance!

 
artem86:

Can you please help me? How to close 5 pending orders with the same magic.

Thank you in advance!


Look in the scripts there should be a similar one.