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

 
romeoboy писал(а) >>

Please don't criticise, I wrote an indicator to learn a programming language!

i will not! keep studying!

insert the computation of the indicator into the Expert Advisor and depending on the text (or replace the variable with a numeric) tell the Expert Advisor what to do!

 
vvavva >> :

I won't! Keep studying!

>> Well, insert the computation of the indicator in the Expert Advisor and depending on the text (or replace the variable with a numeric one) tell the Expert Advisor what to do!

If you can be more specific, please. Write an example

 
if(text=="I")
{
//действие советника 1
}
if(text=="A")
{
//действие советника 2
}
.......
и т.д.
 
vvavva >> :

Something is not working! Apparently I know the language poorly. I've been writing an indicator for 2 weeks, and now I've been writing an EA for 2 weeks. If you do not mind, please write an EA for me based on my indicator. I have a few lines, but I am not smart enough to do it. If you agree, I will write the terms of entry into the market!

 
romeoboy писал(а) >>

Something's not working! I must be a little rusty with the language. I've been writing an indicator for 2 weeks, and now I've been writing an EA for 2 weeks. If you do not mind, please write an EA based on my indicator. I have a few lines, but I am not smart enough to do it. If you agree, I will write the conditions for entering the market!

No! If you're learning, keep learning! There's plenty of examples and a good one in the 'Useful Functions from KimIV' branch.

I think you'll find time for yourself.

 
vvavva >> :

No! If you're learning, keep learning! There's plenty of examples and a useful branch called 'Useful functions from KimIV'.

I think you can make time for yourself.

Ok, thanks for the tip, but if you can tell me how to declare my indicator in the EA and how the EA knows what (text) is in the line (if(text=="I") ). (see my post above)

 
romeoboy писал(а) >>

Ok, thanks for the tip, but if you can tell me how to declare my indicator in the EA and how the EA knows what (text) is in the line (if(text=="I") ). (see your post above)

why do you need an indicator, if the Expert Advisor does the same thing!

int start()
{
  double O, C, H, L, O1, C1, H1, L1, O2, C2, H2, L2;
  string text;
  //будет обработка 1000 баров меняй как вздумается
  int limit=1000;
  if(Bars< limit) limit=Bars;
  //---- last counted bar will be recounted
  for(int i=1; i< limit; i++) 
  {
    O=iOpen(NULL,0, i);
    C=iClose(NULL,0, i);
    H=iHigh(NULL,0, i);
    L=iLow(NULL,0, i);
    
    O1=iOpen(NULL,0, i-1);
    C1=iClose(NULL,0, i-1);
    H1=iHigh(NULL,0, i-1);
    L1=iLow(NULL,0, i-1);
    O2=iOpen(NULL,0, i+1);
    C2=iClose(NULL,0, i+1);
    H2=iHigh(NULL,0, i+1);
    L2=iLow(NULL,0, i+1);

    text="";
    {
      
    }
    
    if (( H> O+0.0001)&&( H< O+0.0001*6)&&( O> L+0.0007)&&( C== H)) text="X";
    if (( H> O+0.0001)&&( H< O+0.0001*6)&&( O> L+0.0007)&&( H> C+0.0000)&&( H< C+0.0004)) text="I";
    if (( O> C+0.0001)&&( O< C+0.0001*6)&&( C> L+0.0007)&&( H== O)) text="L";
    if (( O> C+0.0001)&&( O< C+0.0001*6)&&( C> L+0.0007)&&( H> O+0.0000)&&( H< O+0.0004)) text="A";
    
    if (( C> O+0.0001)&&( C< O+0.0001*6)&&( H> C+0.0007)&&( L== O)) text="X1";
    if (( C> O+0.0001)&&( C< O+0.0001*6)&&( H> C+0.0007)&&( L< O-0.0000)&&( L> O-0.0004)) text="I1";
    if (( O> C+0.0001)&&( O< C+0.0001*6)&&( H> O+0.0007)&&( L== C)) text="L1";
    if (( O> C+0.0001)&&( O< C+0.0001*6)&&( H> O+0.0007)&&( L< C-0.0000)&&( L> C-0.0004)) text="A1";
    
    if (( O== C)&&( H== O)&&( L< H-0.0007)) text="T";
    if (( O== C)&&( H== O)&&( L> H+0.0007)) text="T1";
    //If we found a special candlem write in the Chart
    if( text!="")
    {
      ObjectCreate(DoubleToStr( i,0)+" label", OBJ_TEXT, 0, Time[ i], H);
      ObjectSetText(DoubleToStr( i,0)+" label", text, 20, "Arial", Red);
    }
  }
  
}
Put it in the EA and check it out!
 

Here as an indicator, only it didn't all fit, but you could make another one in this style.

Files:
123_2.mq4  4 kb
 
Hello, could you please write an EA based on FX_Sniper's_Ergodic_CCI_Trigger indicator thanks in advance!
 
Hi all !!! I would be thankful for an EA that will place pending buy stop orders 10 pips above yesterday's high and sell stop orders 10 pips below yesterday's low at the same time. Parameters that I would like it to change: Take Profit, Trailing Stop, Stop Loss, and the number of points opening orders from yesterday's high and low. Thanks in advance.
Reason: