[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 372

 
Chiripaha:

Artem has already said that Stop-Level can also float - it's not a constant! - And the size of the tick is, yes, a constant.

And somehow I haven't thought about it, that stollevel is not a constant value. True to form.

Chiripaha:

The question for productivity (owl optimization) is different. I personally don't cram all these functions into the owl. I just take parameters as I need them. Yes, I have to write more code, but owl handles less "unnecessary" library stuff, because not everything from MarketInfo may turn out to be necessary in owl.

Yes, if you get a bunch of different environment variables through a function, that's not an option either. Apparently, it's easier to get this data as needed before calculations in a specific function.

 
tara:


1. format the code without saving lines (staircase). - can you give a small example?


tara,Chiripaha-Thanks guys, it worked much faster!
 

I have written the first indicator. Everything counts correctly, only problem with display on the last bar and with updating on arrival of a new bar (it does not update).
Here is the picture:

What could be the problem?

Files:
 

advise please, if on a new (not frosted) netbookAsus Eee PC 1025C (white)Intel ® Atom ™ 1600 frequency, gig RAM win 7 Starter put 10 MT4 terminals, without downloading of historical quotes, with one two currency pairs, without indicators and 1 trading advisor for each terminal - netbook will hold them simultaneously?

What if there are 20 МТ4?

I don't think I'll ever need 30 :))

or should i buy a stronger laptop?

 

Fox_RM:

1. Format the code without saving lines (staircase). - Can I have a small example?
Here, an example - your code in a staircase. I had to form it myself first to find what I told you. Otherwise it was difficult for me to find it.
int start()
  {
  
   int    limit;
   int    counted_bars=IndicatorCounted();
   double prev,current;
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

   for(int i=0; i<limit; i++)   // -------------------------------------------- Основной цикл
     {
     
      //---- Awesom + Volumes
     
      AOBuffer3[i]=iMA(NULL,0,EMA,0,MODE_SMA,PRICE_MEDIAN,i)-iMA(NULL,0,SlowEMA3,0,MODE_SMA,PRICE_MEDIAN,i);
      
      if (Show_Volume==true)
       {
        double nSum = Volume[i]*Point*coaf;
        if (AOBuffer3[i]<=0) ExtMapBuffer1[i] =  nSum;
        if (AOBuffer3[i]>0)  ExtMapBuffer1[i] = -nSum;
      
        double Vol_Arr[];
        if (AOBuffer3[i]<=0) Vol_Arr[i] =  Volume[i]*Point*coaf;
        if (AOBuffer3[i]>0)  Vol_Arr[i] = -Volume[i]*Point*coaf;
       }

//----------------------------- Блок поиска значений -----------------------------------------//
 
      //-- Поиск Low & Time & Min_AO 
      if (AOBuffer3[i] < 0)
       {
        price_up_end = 0; 
        AO_up        = 0;  
        price_dn_start = Low[i]; 
        if (price_dn_end == 0) price_dn_end = Low[i]; 
        if (price_dn_start <= price_dn_end)
         {
          price_dn_end = price_dn_start; 
          time_dn      = Time[i]; 
          shift_dn     = iBarShift(NULL, 0, time_dn);
         }
        if (AOBuffer3[i] <= AO_dn)
         {
          AO_dn = AOBuffer3[i]*0.2+AOBuffer3[i]; 
          AO_time_dn = Time[i];
         }
      
        dn_koaf = dn_koaf_round;
        up_koaf_round++;
       }   
  
      //-- Поиск High & Time & Max_AO  
      if (AOBuffer3[i] > 0)
       {
        price_dn_end = 0; AO_dn = 0;  
        price_up_start = High[i];
        
        if (price_up_start >= price_up_end) 
         {
          price_up_end = price_up_start; 
          time_up      = Time[i]; 
          shift_up     = iBarShift(NULL, 0, time_up);
         }
        if (AOBuffer3[i] >= AO_up) 
         {
          AO_up = AOBuffer3[i]*0.2+AOBuffer3[i]; 
          AO_time_up = Time[i];
         }
      
        up_koaf = up_koaf_round;
        dn_koaf_round++;
       }   
//--------------------------------- Выставляем значения --------------------------------------------//
    
      Vol_AO_up = 0; Vol_AO_dn = 0;
      if (shift_up > shift_dn)
       {
        for (int dn_br = shift_dn; dn_br <= shift_up; dn_br++)            //-------------- Перебор значений внутри основного цикла
          {
           Vol_AO_up += Volume[dn_br]; 
           SetText("Awesome_super_volumes"+up_koaf, DoubleToStr(Vol_AO_up,0), AO_time_dn, AO_dn, Blue);
          }   
       }
 
      if (shift_dn > shift_up)
       {
        for (int up_br = shift_up; up_br <= shift_dn; up_br++)            //-------------- Еще один перебор значений внутри основного цикла
          {
           Vol_AO_dn += Volume[up_br]; 
           SetText("Awesome_super_volumes"+dn_koaf, DoubleToStr(Vol_AO_dn,0), AO_time_up, AO_up, Red);
          }   
       }
     } 
           
//---- done

   return(0);
  }
 
Chiripaha:
Here, an example is your staircase code. In order to find what I told you I had to formulate it myself first. Otherwise it was difficult for me to find it.


OK! Thank you!
 
lottamer:

advise please, if on a new (not frosted) netbookAsus Eee PC 1025C (white)Intel ® Atom ™ 1600 frequency, gig RAM win 7 Starter put 10 MT4 terminals, without downloading of historical quotes, with one two currency pairs, without indicators and 1 trading advisor for each terminal - netbook will hold them simultaneously?

What if there are 20 МТ4?

I don't think I will ever need 30 of them :))

or should i buy a stronger laptop?

CPU, most likely, will suffice. But memory for 30 or more... Again, it depends on what you are going to do with these terminals. If, as you have described, 2-3 currency pairs, just to trade - then invest more memory at the rate of 100-150 mb for 1 terminal (it takes me so) and go ahead. But, when you have more than even 5, you will just get tired of switching between them on your laptop. I get 7, but that's on 4 monitors (not laptop monitors, i.e. not small ones). Your gig of RAM is only enough for 7. : )) This should be taken literally. And if it also takes away from this memory and video. A laptop is meant for 1-2 mt4. To do something fast. (imho)
A 10 inch screen will "break" your eyes. My friend is using your model as a substitute. And strongly recommends at least 13-14 inches. And the memory 2 GB max - it's not enough if you'll really put 20 pieces, and probably still use something else - at least the Internet... Video memory is taken from the total memory. - Up to 4GB is better.
 
sv.:

I have written the first indicator. Everything counts correctly, only problem with display on the last bar and with updating on arrival of a new bar (it does not update).
Here is the picture:

What could be the problem?

Your indicator doesn't show up at all... It's not today - I'll try it later, if someone more experienced won't tell me by that time.
 
Chiripaha:
And your indicator doesn't show up at all... That's not today - I'll get around to it later, if someone more experienced doesn't suggest it by then.


That's strange.
I checked, it's showing.
I've checked it. Maybe you need to shrink the graph vertically, if the channel is wide, you might not see it when zoomed in.
 
Chiripaha:
The processor is probably enough. But 30 or more memory. Again, it depends on what you are going to do with these terminals. If, as you described, 2-3 currency pairs, just trade - install more memory at the rate of 100-150 mb for 1 terminal (it takes me so) and go ahead. But, when you have more than 5, you will just get tired of switching between them on your laptop. I get 7, but that's on 4 monitors (not laptop monitors, i.e. not small ones). Your gig of RAM is only enough for 7. : )) This should be taken literally. And if it also takes away from this memory and video. A laptop is meant for 1-2 mt4. To do something fast. (imho)
10 inch screen - you'll "break your eyes" on it. My friend is using your model as a substitute, but it is XP x86. And strongly recommends at least 13-14 inches. And the memory is 2 GB max - not enough if you'll really put 20 pieces, and probably because you'll use something else - at least the Internet... Video memory is taken from the total memory. - Up to 4GB is better.

The idea is this: I need a dedicated server so that my EAs can run on it around the clock and not distract me or my main computer. It makes sense to buy VPS, but there are security problems, plus it still costs money - at least 400 rubles per month. It's a great idea.

My device has only one thing to do: it has ONLY MT4, at most lightweight, without indicators, with one working Expert Advisor. On my computer, an example of such MT4 takes 30 meters of RAM. So, logically, 10 of them will occupy 300 meters.

For 10 it should be enough. But taking into account WIN7 for 20 Мt4 600 meters of free memory may not be enough... I guess I'll have to look for a netbook with 2 GB of RAM.

My netbook won't do anything else. No Internet, no programs, NOTHING! In fact, I turned it on Monday and forgot about it. On Friday night you switch it off. 11 hours of battery life will allow to work in case of emergency...+GPRS modem...

Reason: