[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 415

 
Necron писал(а) >>

Part 2.

// it is important to enter the market correctly, 
   // but it is more important to exit it correctly...   
   for( cnt=0; cnt< total; cnt++)
     {
      OrderSelect( cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL &&   // check for opened position 
         OrderSymbol()==Symbol())  // check for symbol
        {
OrderSend( 
         if(OrderType()==OP_BUY)   // long position is opened
Take a good look at this piece.
 
Vinin >>:
Посмотри внимательно на этот кусок

Thank you so much!

 
am I imagining things or can some variables retain their values after recompiling or restarting the EA?
 
And one last question. Is it possible to make a signal (main) used in the EA on one timeframe (eg H1), and the position is added to the signal from the lower TF (eg M5)? I wrote it, but it opens trades without pauses (or maybe Sleep() should be added). It seems to be one signal on H1, but it opens a hundred deals. The variables seem to be correct, they are based on the previous bar, not zero. Only one condition uses a breakdown of the previous bar high (High(0)>High(1)) and the respective low. In general, is it possible to use this method or only one timeframe should the EA work? There is a lot of history, too.
 
Necron писал(а) >>
And one last question. Is it possible to make a signal (main) used on one timeframe (eg H1), and the position was added by a signal from a lower TF (eg M5)? I wrote it, but it opens trades without stops (or maybe Sleep() should be added). It seems to be one signal on H1, but it opens deals as much as one hundred. The variables seem to be correct, they are based on the previous bar, not zero. Only one condition uses a breakdown of the previous bar high (High(0)>High(1)) and the respective low. In general, is it possible to use this method or only one timeframe should the EA work? There is a lot of history, too.

And it's up to you what you want. Even on all timeframes, and on all available instruments.

 
Vinin >>:

А это уже как Вам будет угодно. Хоть по всем таймфреймам, да еще и по всем инструментам доступным.

And in variables just put 5 where the timeframe is and that's it (if for pentameter)?

high5=iHigh(NULL,5,1);

 
Necron писал(а) >>

And in variables just put 5 where the timeframe is and that's it (if for pentameter)?

high5=iHigh(NULL,5,1);

What about the hourlies?

 
Vinin >>:

А как тогда часовики?

high=iHigh(NULL,60,1); Or is something wrong?

 

Can you tell me how to pass one dimension from a two-dimensional array to a function?

I'm confused about something.

int testarray[5][2] = {1,2,3,4,5,6,7,8,9,10};

void testfunc(int &inarray[]){
string out_str="Result: "+inarray[0];

for (int i=1;i<5;i++){
out_str += (", "+inarray[i]);
}
Print(out_str);
}
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
Print("Call first:");
testfunc(testarray[][0]);
Print("Call second:");
testfunc(testarray[][1]);
//----
return(0);
}
//+-----------



It won't compile. :(

 

an array is a complete component, pass it in its entirety and process it as needed...

Reason: