Learning logic - page 2

 
From now on, a lack of office and zip is no longer a sign of a lack of logic :)
 
Integer:

You know, and we don't have a problem. Especially for YOU in text format. You obviously have a zip file.


From what I've read: "...... and errors occurring due to improper verbal expression of thought."

I forgot to put a smiley at the very end of my first post.

 
DDFedor:

Why do you need a smiley face? Do you think the thread is a joke?

No ... smiley faces are different (there are some really sad ones)
 
age_nt:
Victor! If I understand correctly, you are ready to help.... I can't understand where I have "no logic"


Shall we begin?

This is the part where it doesn't make sense to me in the context of the code:

bool showEUR, showUSD, showGBP, showCHF, showJPY, showRAVI;
   if ( StringFind(Symbol(), "EUR", 0) != -1) showEUR = TRUE;
   if ( StringFind(Symbol(), "USD", 0) != -1) showUSD = TRUE;
   if ( StringFind(Symbol(), "GBP", 0) != -1) showGBP = TRUE;
   if ( StringFind(Symbol(), "CHF", 0) != -1) showCHF = TRUE;
   if ( StringFind(Symbol(), "JPY", 0) != -1) showJPY = TRUE;

There is no explicit initialisation, although there is one elsewhere. Boolean expressions are not used. One variable has dropped out altogether. Non-standard formatting.

I'm ready to listen to objections.

 
gip:


Non-standard formatting.


explain
 

i tried to write an indicator that initially would be colored bars in the desired colour. i can't understand the logic of the code, i built it from the ready-made code of another indicator, but i can't find it :(

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Red

#property indicator_width1 2
#property indicator_width2 2

extern int NumBars   =  100;

double upbuf[];
double dnbuf[];

int init() {
   IndicatorBuffers(2);
   SetIndexBuffer(0, upbuf);
   SetIndexBuffer(1, dnbuf);
   SetIndexStyle(0, DRAW_HISTOGRAM,STYLE_SOLID);
   SetIndexStyle(1, DRAW_HISTOGRAM,STYLE_SOLID);
   IndicatorShortName("Bars");
   return (0);
}

int deinit() {
   return (0);
}



int start() {
   int counted = IndicatorCounted();
   if (counted < 0) return (-1);
   int draw  = Bars - counted + NumBars + 1;
   int i;
   if (draw > Bars) i = Bars;
   for (i = draw; i >=0 ; i--) {
   if (Low[i] < Open[i]) {
         upbuf[i] = Open[i];
         dnbuf[i] = Low[i];
      } else {
             upbuf[i] =High[i];
             dnbuf[i] =Open[i]; 
         }
    }
   return (0);
}

i need clarification of how to paint the last 100 bars in two colours.

The goal is simple - to learn to work correctly with the type of lines DRAW_HISTOGRAM and correctly calculate the number of bars that have changed since the last indicator call

 
sanyooooook:
explain

His formatting style does not allow spaces within expressions. And there are spaces in this place. It would make sense to stick to one style.
 

Functionally, this is for the convenience of displaying on the graph and does not affect the accuracy of the calculation (as far as I understand).

In other indexers it works, but it is possible to remove the block at all, so as not to embarrass the eye.... leave

int init()
  {
//---- indicators

   IndicatorBuffers(5);

   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));

//---- indicator line
   SetIndexBuffer(0,EUR_Buffer);
   SetIndexBuffer(1,USD_Buffer);
   SetIndexBuffer(2,GBP_Buffer);
   SetIndexBuffer(3,CHF_Buffer);
   SetIndexBuffer(4,JPY_Buffer);

   SetIndexLabel(0,"EUR");
   SetIndexLabel(1,"USD");
   SetIndexLabel(2,"GBP");
   SetIndexLabel(3,"CHF");
   SetIndexLabel(4,"JPY");

   
   SetIndexDrawBegin(0,0);
   SetIndexDrawBegin(1,0);
   SetIndexDrawBegin(2,0);
   SetIndexDrawBegin(3,0);
   SetIndexDrawBegin(4,0);

   
   IndicatorShortName("all1");

//----
   return(0);
  }
 
age_nt:
Victor! If I understand correctly, you are ready to help.... I can't understand where I have "no logic"


Are you familiar with Russian syntax and morphology?

Read the first post again.

 
rid:

Yes, a useful case will be made!

//---------------

p/s - Victor, happy upcoming (tomorrow) birthday!

Seconded by!!!!!!!!!!!
Reason: