[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 348

 

No, I just need

OrderSend("EURUSD", OP_BUY,0.1,Ask,0,Ask-400*Point,Ask+100*Point);

Stop has been written correctly only for Bai.

For Bays, they are in the other direction signs SL + up, TP - down.

and it is also recommended to normalize all calculated prices by Digits signs before passing them into OrderSend

NormalizeDouble(Ask-100*Point, Digits)

 
-Viktoria-:
...an indicator that highlights certain time periods in colour...
i-Sessions-02.mq4
 
Thank you so much!!! :)
 
Roger:


You can do the following: declare a two-dimensional array, transfer the required amount of data from the series to it, then sort it by the first dimension. In the second dimension will be the bar numbers. To see how it works, see an example

I don't understand something.

Declare the dubs as:

double a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;

Initialised them with volumes and inserted them into an array:

int start() {

a1=Volume[1],
a2=Volume[2],
a3=Volume[3],
a4=Volume[4],
a5=Volume[5],
a6=Volume[6],
a7=Volume[7],
a8=Volume[8],
a9=Volume[9],
a10=Volume[10];

int mas1[10]={a1,a2,a3,a4,a5,a6,a7,a8,a9,a10}; //Вот здесь компилятор что-то хочет в конце строки
int mas2[10][2];


When compiling an error - comma or semicolon expected

Can you tell me what he wants?

 
sergeev:

No, I just need

OrderSend("EURUSD", OP_BUY,0.1,Ask,0,Ask-400*Point,Ask+100*Point);

You can't do that, in which case the Ask will take over from the timetable. It has to be

double newAsk = MarketInfo("EURUSD",MODE_ASK);
OrderSend("EURUSD", OP_BUY,0.1,newAsk,0,newAsk-400*Point,newAsk+100*Point);
 
-xlapex-:

I don't understand something.

You can't declare arrays this way, and there's no need in your case, you already have a Volume array, so insert it in the loop with the appropriate index, somewhere like this:

mas2[i,0]=Volume[i];

 
Roger:

You can't declare arrays this way, and there's no need in your case, you already have a Volume array, so insert it into the loop with the appropriate index, somewhere like this:

mas2[i,0]=Volume[i];

Thank you very much Roger, I've finally figured out how to do it!
 
Roger:

You can't declare arrays this way, and there's no need in your case, you already have a Volume array, so insert it into the loop with the appropriate index, somewhere like this:

mas2[i,0]=Volume[i];

Another question on the same subject.

After sorting, I display data from the arrays in the alert:

ArraySort(mas2);
min_2=mas2[2,0];
min_V2=mas2[2,1];
Alert(min_2," ",min_V2," ", High[min_V2]);

Everything displays fine.

BUT, if I try to output to a chart - no reaction! :

ArraySort(mas2);
min_1=mas2[1,0];
min_V1=mas2[1,1];
min_2=mas2[2,0];
min_V2=mas2[2,1];

ObjectCreate("", OBJ_HLINE,0,0,High[min_V2]);
ObjectSet("", OBJPROP_COLOR,Ex_col_1);
ObjectSet("", OBJPROP_STYLE, 0);
ObjectSet("", OBJPROP_WIDTH , 2);



What should I do?

 
-xlapex-:

Another question on the same subject. What should be done?

рабочий пример:

void create_line(string name_line,double level,color c,int style,int w){
   if(ObjectFind(name_line)<0 ) {
   
  ObjectCreate(name_line, OBJ_HLINE, 0, 0,0);
  ObjectSet(name_line, OBJPROP_PRICE1, level);
  ObjectSet(name_line, OBJPROP_COLOR , c);
  ObjectSet(name_line, OBJPROP_STYLE , style);
  ObjectSet(name_line, OBJPROP_WIDTH , w);
   WindowRedraw();      }  
   
   else {
  ObjectMove(name_line,0,Time[1],level);  
  WindowRedraw();      } 
                  } 
 
To:

Tried it this way too, it doesn't want to draw. For some reason, the terminal doesn't recognize PRICE coordinate of my kind - High[min_V2], where min_V2 is an array element. I cannot understand how to display an array element not as Print, Message or Alert, but as some object on a chart. And this is not the first example I've encountered - I have a problem with arrays...