[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 290

 
artmedia70:

I think we can't do without some kind of own order bookkeeping here.

Create your own array of orders and store all the necessary virtual stop data in it.

Can you go into more detail about this?

Has this been implemented anywhere? My searches haven't led to anything ((

 
Centuriy:

Can you tell me more about it?

Has this been implemented anywhere? My searches haven't led to anything (e.g., I can't find anything).

It can be implemented as a separate function for Expert Advisors or as an independent Expert Advisor.

I have implemented it as a function for a custom EA, but everything in this world can be changed, if only I had the motivation...

 
Centuriy:

Can you go into more detail about this?

has this been implemented anywhere? my searches have been fruitless(?)


Have a look at this one, there are a few options there:

http://www.fx4u.ru/rinki-forex-commodities-cfd-futures-f14/yazik-programmirovaniya-mql4-opisanie-mts-skrip-f16/virtualniy-treyling-stop-ot-1-punkta-t12781.html

Sorry for the third-party link

 

Hi all, how do I remove the display of buffer number 1(Buffer1[])?

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0
#property indicator_color2 Red
#property indicator_width2 2
#property indicator_style2 0

double Buffer1[];
double Buffer2[];

int init(){
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
return(0);
}
int start(){
for(int i=0;i<Bars;i++){
Buffer1[i]=iClose("EURUSD",0,i)-1;
Buffer2[i]=(Buffer1[i]+Buffer1[i+1]+Buffer1[i+2])/3;
}
return(0);
}

 
Figar0:


Have a look at this one, there are several options there:

Thank you very much as a human being!

 

tmt0086:

Hi all, how to remove buffer number 1(Buffer1[]) from display?


a quick

SetIndexStyle(0, DRAW_NONE);

 
sergeev:


Quickly

SetIndexStyle(0, DRAW_NONE);


but if not fast? because it interferes(( let's say the bounds from it are high and it interferes with normal work. it only helped that the buffer disappeared from the chart, but the bounds from this buffer remained
 
tmt0086:

Hi all, how do I remove the display of buffer number 1(Buffer1[])?

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0
#property indicator_color2 Red
#property indicator_width2 2
#property indicator_style2 0

double Buffer1[];
double Buffer2[];

int init(){
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
return(0);
}
int start(){
for(int i=0;i<Bars;i++){
Buffer1[i]=iClose("EURUSD",0,i)-1;
Buffer2[i]=(Buffer1[i]+Buffer1[i+1]+Buffer1[i+2])/3;
}
return(0);
}

Try it like this:
______________________________________

#property indicator_buffers 1

Swap the buffers and remove

SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
______________________________________
Honestly, I haven't tested it, but it should work.
Or maybe you don't need to swap anything, just remove setting parameters of unnecessary buffer and replace 2 with 1

 
artmedia70:

Try it like this:
______________________________________

#property indicator_buffers 1

Swap the buffers and remove

SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
______________________________________
Honestly, I haven't tested it, but it should work


#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0

double Buffer1[];
double Buffer2[];

int init(){
SetIndexBuffer(0,Buffer2);
SetIndexStyle(0,DRAW_LINE);
return(0);
}
int start(){
for(int i=0;i<Bars;i++){
Buffer1[i]=iClose("EURUSD",0,i)-1;
Buffer2[i]=(Buffer1[i]+Buffer1[i+1]+Buffer1[i+2])/3;
}
return(0);
}
right?
 
like this
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_style1 0

double Buffer1[], Buffer2[];

int init()
{
  IndicatorBuffers(2);
  SetIndexBuffer(0,Buffer2); SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(1,Buffer1);
  return(0);
}

int start()
{
  for(int i=0;i<Bars;i++)
  {
    Buffer1[i]=iClose("EURUSD",0,i)-1;
    Buffer2[i]=(Buffer1[i]+Buffer1[i+1]+Buffer1[i+2])/3;
  }
  return(0);
}

You do have to use a buffer.
Reason: