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

 
smart:


Can you tell me, when an EA comes with a set, which folder should I put it in? Thank you.


C:\Program Files\MT4\experts\presets
 
orb:

Good afternoon!

Can you help, reading from a file, there is one line (and generally speaking there will be more, but it does not matter), it loops, as if does not see the end of the file...

Fixed it seems, now another problem when reading from a file, the values in the array are 0, I suspect that the decimal places are wrong. I'm attaching the code and a line from the file to make it clear what I'm talking about. This is what you get when testing through Print:

Histxmas[0][0]=0; Histxmas[0][1]=0; Histxmas[0][2]=0; Histxmas[0][3]=0.

Code:

 int qq=0;
 while (FileIsEnding(h3)==false)
 {
  Histxmas[qq][0]=StrToDouble(FileReadString(h3));
  Print("Histxmas[",qq,"][",0,"]=",Histxmas[qq][0]);
  Histxmas[qq][1]=StrToDouble(FileReadString(h3));
  Print("Histxmas[",qq,"][",1,"]=",Histxmas[qq][1]);
  Histxmas[qq][3]=StrToDouble(FileReadString(h3));
  Print("Histxmas[",qq,"][",2,"]=",Histxmas[qq][2]);
  Histxmas[qq][4]=StrToDouble(FileReadString(h3));
  Print("Histxmas[",qq,"][",3,"]=",Histxmas[qq][3]);
  qq++;
}

File:

 
orb:

I fixed it, now I have another problem when reading from the file, the values in the array are 0, I suspect that the number of decimal places is wrong. I'm attaching the code and a line from the file to make it clear what I'm talking about. This is what you get when testing through Print:

Histxmas[0][0]=0; Histxmas[0][1]=0; Histxmas[0][2]=0; Histxmas[0][3]=0.

Code:

File:


Maybe the problem is with delimiters. Check int FileOpen( string filename, int mode, int delimiter=';') operator and your file.
 

Good afternoon.

Already racked my brain.

Why trades on demo do not open with this code on A...ri: everything is fine in tester.

   if(BSo==OP_BUY && NeedOrder1 && !b1)
   {
        urb=NormalizeDouble(Ask,Digits);
        tp=NormalizeDouble(urb+TakeProfit*Point,Digits);
        sll=NormalizeDouble(niz-tr,Digits);
        if(Ask-sll<STP*Point) {Print ("Стоплосс слишком близко к цене "+sll); Sleep(20000);return(0);}

    

      tick=OrderSend(Symbol(),OP_BUY,Lot,urb,200,sll,tp,CMM,MAGIC+1,0,Red);
      if(tick>0)
      {
         ticknum=0;
         while(ticknum<90 && !OrderSelect(tick,SELECT_BY_TICKET))
         {
            ticknum++; Sleep(2000);
         }
      }

   }
 
Stells:

Good afternoon.

Already racked my brain.

Why trades on demo do not open with this code on A...ri: everything is fine in tester.


what options have you tried?
 
sergeev:

And what options have you tried?


I've tried everything, I even gave it to a friend.

He's got the same thing, doesn't trade on the demo.

I inserted a signal in parallel, to draw an arrow.

The arrow draws, the order does not open. :((

 
and what options have you tried for opening an order?
 
sergeev:
And what variants of order opening parameters have you tried?


Just like this.

I immediately put a takeprofit and a stoploss.

Of course you can open an order and then modify it, but it has always worked on A...ri.

 

Guys, I made a counter here...it determines the minimum value for an n period...is this correct or not?

 for(int i=0; i<N; i++){
    A=low[i];
    if (min<A)   {  min=A;   }
    }
 

Guys, I made a counter here...it determines the minimum value for an n period...is this correct or not?

 for(int i=0; i<N; i++){
    A=low[i];
    if (min<A)   {  min=A;   }
    }
Reason: