[Archive!] Writing an advisor for free - page 25

 
for (int i=Bars-2; i>=0; i--)
{
 double dc=Close[ i]-Close[ i+1];
 if ( dc>=0) dc_D[ i]= dc; else dc_U[ i]=- dc;
 if ( mr==1) { U[ i]= mov( dc_U[ i], n, s);  D[ i]= mov( dc_D[ i], n, s); }
 if ( mr==2) { U[ i]= U[ i+1]*( n-1)+ dc_U[ i])/ n;  D[ i]= D[ i+1]*( n-1)+ dc_D[ i])/ n;  }
 if ( D[ i]!=0 && 1+ U[ i]/ D[ i]!=0)
 {
  if ( mru==1) MyRSI[ i]= mov(100/(1+ U[ i]/ D[ i]), n1, s); 
  if ( mru==2) MyRSI[ i]= mov(100/(1+ U[ i]/ D[ i]), n1, e);
 }
}

That's it. I'm not quite sure what mov is. It seems to me to be a moving average calculation

dc_D,  dc_U, D, U, MyRSI - // это индикаторные буфера
 

Yes, U[i]=mov(dc_U[i], n, s) simple moving average.

so, it turns out that we haven't filled all arrays yet, but we're already referring to them, or no?

in this line?

if (mr==2) { U[i]=U[i+1]*(n-1)+dc_U[i])/n; D[i]=D[i+1]*(n-1)+dc_D[i])/n; }

 

Sorry. Can I not have an indicator, but just code to insert into an EA to get a value?

 
Hello, could you write an EA for a non indicator strategy, I can describe everything in detail, and even attach a picture if needed. I am looking forward to hearing from you. I will even attach a picture if necessary.
 
Gigabyte >>:
Здравствуйте, скажите, а Вы можете написать советника по без индикаторной стратегии, я могу подробно все описать, и даже картинку если надо прикреплю. Жду ответа. Спасибо.

read the first post of this thread.

 
Hello, Very nice 10 pips Expert Advisor for EURUSD & GBPUSD, Breaking high & low of previous day, Can it be slightly modified, if I open BUYSTOP, EA will open a position with H+spread+0.00003 points and if I open SELLSTOP, EA will open a position with L-0.00003 points.


Example, when opening a Buy order: ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,H+Spred+Spred,0,H-SL+Spred+Spred,H+TP+Spred+Spred,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-Existing data.

Change to: ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,H+Spred+0.00003,0,H-SL+Spred+0.00003,H+TP+Spred+0.00003,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-Changed data.

Example at opening a Sell order:ticket=OrderSend(Symbol(),OP_SELLSTOP,Lot,L-Spred,0,L-Spred+SL,L-Spred-TP,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-existing data.

Change to:ticket=OrderSend(Symbol(),OP_SELLSTOP,Lot,L-0,00003,0,L-0,00003+SL,L-0,00003-TP,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-changed data

H - previous day's maximum

L - previous day's minimum

0.00003 - number of points for MT4 with five digit quotes.( And to always change number of points
Files:
expertq10.mq4  5 kb
 
If I want to get a reverse position on my account, instead of sell - buy, instead of TP - SL, instead of SL - TP, with pending trades according to the same scheme, I will be very grateful, but within reasonable limits.
 
sigma_sura >>:
Господа программисты, знатоки MQL очень хочется копировщик сделок с реверсом, т.е. чтобы была возможность открывать противоположные образцовому счету ордера, очень пригодится для сливающих советников ну и всяких сливаторов, чтобы был полный переворот: например если сигнал на sell c TP и SL на образцовом счете, а на моем счете чтобы открывалась полностью обратная позиция вместо sell - buy, вместо TP - SL, вместо SL - TP, с отложенниками все по такой же схеме, буду очень признателен, но в разумных пределах.


I think Kim has one of these, check his website.
 
Vinin >>:

А в какой зигзаг? а то их много.

Hello, Very nice 10 pips Expert Advisor for EURUSD & GBPUSD, Breaking high & low of previous day, Can it be slightly modified, if I open BUYSTOP, EA will open a position with H+spread+0.00003 points and if I open SELLSTOP, EA will open a position with L-0.00003 points.


Example, when opening a Buy order: ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,H+Spred+Spred,0,H-SL+Spred+Spred,H+TP+Spred+Spred,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-Existing data.

Change to: ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,H+Spred+0.00003,0,H-SL+Spred+0.00003,H+TP+Spred+0.00003,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-Changed data.

Example at opening a Sell order:ticket=OrderSend(Symbol(),OP_SELLSTOP,Lot,L-Spred,0,L-Spred+SL,L-Spred-TP,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-existing data.

Change to:ticket=OrderSend(Symbol(),OP_SELLSTOP,Lot,L-0,00003,0,L-0,00003+SL,L-0,00003-TP,NULL,MagicNumber,iTime( Symbol(), PERIOD_D1, 0 ) + 86400);-changed data

H - maximum of previous day

L - previous day's minimum

0.00003 - number of pips for MT4 with five-digit quotes.( And to always change the number of pips

Files:
expertu10.mq4  5 kb
 
vasilii8-85 >>:

So what is your problem? You have written what you want to change (and how you want to change it:)). All you have to do is to open MetaEditor and fix the code. So that you can change the number of points, do the following:

extern double delta=0.00003;//вставить перед start()
And everywhere in the code where you want to put 0.00003 write delta 
PS. Writing the same question in several topics is not good:)
Reason: