Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1073

 
nikelodeon:
Good day all!!! Let's assume there is a buffer in the indicator that I need to use in the calculation of other indicators. I want to use it in calculation of other indicators. How to make the indicator buffer be present but it doesn't show any icons on the chart? Thanks all!!!!
Here is an example for 2 drawn (b1, b2) and 2 calculated buffers (b3, b4), the calculated ones are not displayed in the terminal:
#property indicator_buffers       2
#property  indicator_level1        0
#property indicator_levelcolor    Silver
#property  indicator_type1         DRAW_LINE
#property  indicator_color1        Crimson
#property  indicator_width1        2
#property  indicator_type2         DRAW_LINE
#property  indicator_color2        SteelBlue
#property  indicator_style2        STYLE_DOT
#property  indicator_width2        1

double b1[];
double b2[];
double b3[];
double b4[];

int OnInit()
{
//--- indicator buffers mapping
  IndicatorBuffers(4);
  SetIndexBuffer(0,b1,INDICATOR_DATA);
  SetIndexBuffer(1,b2,INDICATOR_DATA);
  SetIndexBuffer(2,b3,INDICATOR_CALCULATIONS);
  SetIndexBuffer(3,b4,INDICATOR_CALCULATIONS);
  SetIndexLabel (0, "b1");
  SetIndexLabel (1, "b2");
////...
  return(INIT_SUCCEEDED);
}
 
nikelodeon:   ... make the indicator buffer ... not to display any icons on the chart

Look at SetIndexStyle() help and there are line drawing styles and DRAW_NONE

 
evillive:
Here is an example for 2 drawing buffers (b1, b2) and 2 calculation buffers (b3, b4), calculation buffers are not shown in the terminal:
Yes and no way, they are not displayed because the number of buffers is specified as 2. And you cannot access buffers 3 and 4 from another indicator.... Which surprises me......
 
LRA:

Look at the SetIndexStyle() help function and there are line drawing styles and DRAW_NONE

Now that's really on point. Thanks a lot.... I was getting such a mess on the chart in pairs. It's OK now...
 
nikelodeon:
You can't see them because the number of buffers is specified as 2. And there is no possibility to apply to buffer 3 and 4 from another indicator.... Which surprises me......

Well, only DRAW_NONE then.

I just don't understand why you need to put an indicator on a chart that is called via iCustom...

 
evillive:
Well only DRAW_NONE then.
From the heart into the soul :-)
 
Good day all! After I placed my robot on several pairs, I faced a small problem, which probably everyone has already passed: if I have several open orders on different pairs, when CloseAllBuy() is triggered on one of them, all BAMs on all pairs are closed. How to avoid it, I don't know. Inserting magic check (see below), I get a message about wrong ticket. Who has a solution, please help. Thanks. void CloseAllBuy()
{
The bool fc;
for (int i=OrdersTotal()-1; i>=0; i--)
{
if(OrderMagicNumber()!=magic || OrderSymbol()!=Symbol()) continue;
if(OrderType()==OP_BUY && OrderMagicNumber()==magic)
{
fc=OrderClose (OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),slip);
buycloseprice=0.0;
tc=OrderCloseTime();
}
}
}
 
rapid_minus I get a message about an invalid ticket. OrderTicket()

Vladimir! Add OrderSelect() to the beginning of the loop

 
Thank you. Put it in, it's fine on the tester. Will run it on demo.
 
Good day to all. Guys tell me how you can build an indicator from an indicator. e.g. a mask built on another mask, or Momentum built not on close prices, but on another Momentum???? So called building an indicator from an indicator....