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

 
Usual_Trader:

would you add a message that is logged when orders are closed or does it not reach the closing attempt at all?

Here is a screenshot during testing... Orders are only closed at Take Profit or Stop Loss, but not at the criterion specified in the code ((. (Orders should close each time a stochastic crosses lines)
 
Equilibrium:

Here is a screenshot during testing... Orders are closed only at Take Profit or Stop Loss, but not at the criterion specified in the code ((. (Closing should happen every time stochastic lines are crossed, same as opening)

 

Hello.

I have an indicator. It is written in the code:

#property indicator_chart_window

Naturally, when you put this indicator on a symbol chart, it is drawn in the main window.

Question: How can I make this indicator be drawn in the additional window without any code changes?

 
MaxZ:

Hello.

There is an indicator. It is written in the code:

Naturally, when you put this indicator on the symbol chart, it is drawn in the main window.

Question: How can I draw this indicator in an additional window without code editing?


#property indicator_separate_window
 
Equilibrium:

Here is a screenshot from testing. Orders are closing only at Take Profit or Stop Loss. (Closing should happen every time stochastic lines are crossed)


Why are you making such a mess? Since your entry point into the market is the entry point to the opposite side, you should first close and then immediately open an order without creating a bunch of logical variables. In this case, you are working on a zero bar and stochastic conditions may change even on every tick.

Or, if you want something more or less similar to work, try to swap the while loops that open and close the loop - first close, then open, but imho, in this style of writing it is difficult to debug the program. Learn to use functions, for example, separate functions for closing and opening

 
MaxZ:

Question: How can I make this indicator be drawn in an additional window without editing the code?

You have to go through the templates, I guess. There is definitely no other way to do this without editing the code.
 

Hi all!

Dear forum users, help me out here.

I have an indicator that displays highs and lows for the last n bars. The information is displayed as a symbol and I want it as a line.

Can you please tell me how to correct the code?

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

extern int Quant_Bars = 5; //количество баров
int i;                     //номер бара
int Minimum;               //минимум за n баров
int Maximum;               //максимум за n баров

//--- buffers
double Line_1[];     //объявление массивов под..
double Line_2[];     //..буферы индикаторов

int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);                 //стиль линии
   SetIndexBuffer(0,Line_1);                    //назнач. массива буферу
   SetIndexStyle(1,DRAW_ARROW);                 //стиль линии
   SetIndexBuffer(1,Line_2);                    //назнач. массива буферу
//----
   return;                                      
  }

int start()
  {                        
   double Minimum = Bid;      //мин. цена
   double Maximum = Bid;      //макс. цена
   
   for(i=1; i<=Quant_Bars; i++)
   {
    if(Low[i]<Minimum)        //если меньше известного..
       Minimum = Low[i];      //..то оно и будет минимальным
      
    if(High[i]>Maximum)       //если большн известного..
       Maximum = High[i];     //..то оно и будет максимальным
    }
       
    Line_1[i] = Minimum;      //отобразить линию минимума
    Line_2[i] = Maximum;      //отобразить линию максимума
   
   return;
  }

 
TheXpert:
Digging around in the templates I guess. There's definitely no other way without editing the code.

Thank you for your reply! I came across just such a pattern. Thought this effect was derived from some settings in MT.


r772ra:
#property indicator_separate_window
Beginner's answer to Beginner's answer!? :))))
 

I do not like the history on some brokerage companies, Expert Advisor is much worse optimized, but I am satisfied with trading conditions. I have an idea to divide the Expert Advisor into 2 parts - one part works with one brokerage company, monitors the chart and generates signals, the second part works with another one, takes signals from the first one and places orders.

So, there are two ways to solve this problem

1) subscribe to our own signals according to the latest update of MQ. But we would like to make the exchange within one computer

2) Arrange the exchange through a file (or buffer). Maybe someone has done similar? Throw me a link, please, or tell me where to dig

 
r772ra:
#property indicator_separate_window

Here's the famous idnikator.

Can you get a picture like this!? :))))))


Files: