Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1366

 
Valeriy Yastremskiy:

Wanted to print the chart on a colour printer with the 4K terminal's standard printout. It doesn't work. It prints black and white, although the printer settings show a colour photo. The preview is also black and white. Does it print in black and white only?

The printer prints a picture and saves it as a picture, of course, but it is not good.

A man comes to a fortune-teller:

- They say you can tell the future?

- I do.

and then the man throws a stack of printed charts on the table :)

 
Vitaly Muzichenko:

A man goes to a fortune teller:

- They say you can tell the future?

- I do.

And then the man throws a stack of printed charts on the table :)

well, as if he didn't expect the picture to be saved in colour, but he couldn't beat the printing) Xerox 6010. MT4 1320

http://joxi.ru/V2Vb46dUk5O0Y2

 
Valeriy Yastremskiy:

well kinda didn't expect the picture to be saved in colour, but I couldn't beat the printing) Xerox 6010. MT4 1320

http://joxi.ru/V2Vb46dUk5O0Y2


I tried it just for fun.

The graph is black and white but for example the objects are in colour. But they look terrible on the print. Everything is all wrong!

The text is all wrong. ...

 
MakarFX:

Artem gave a good link here

That's all well and good, but there's no magik history here either. We will have to choose by the time of opening a position, there is everything for that here.

 
Valeriy Yastremskiy:

Wanted to print the chart on a colour printer with the 4K terminal's standard printout. It doesn't work. It prints black and white, although the printer settings show a colour photo. The preview is also black and white. Does it print in black and white only?

Printscan and, save the picture as, of course, is the way out, but not good.

I tried changing the resolution.

It works the way you want it to.


 
MakarFX:

Tried changing the resolution

It'll turn out the way you want it.

There's no problem with the picture. It's a standard print from the terminal.

Vladislav Andruschenko:


I tried it just for fun.

The graph is black and white, but the objects are in colour. But they look terrible in the printout. It's all messed up!

The text is all messed up. ...

Yeah, and I just noticed, my comments aren't in the printout.)

 
Valeriy Yastremskiy:

There is no problem with the picture. The standard printout is from the terminal.

Yes, and just noticed, my comments are not on the print)

In 14 years (almost) I've never once seen this item on the menu ............

And now it hurts my eyes and soul that I can't print my charts now (I don't need them................ )

{{{{{{{{

 
Vladislav Andruschenko:

In 14 years (almost) I've never seen this menu item ............

And now it's cutting my eyes and soul from not being able to print my charts now (I don't need them................ )

{{{{{{{{

Yes, there was no sadness ( colour laser printer ))))
 
Valeriy Yastremskiy:

Wanted to print the chart on a colour printer with the 4K terminal's standard printout. It doesn't work. It prints black and white, although the printer settings show a colour photo. The preview is also black and white. Does it print in black and white only?

Printscreen and save the picture as, of course, output, but not good.

 

Good afternoon everyone. Grail machine doesn't want to work without checking for a new bar - it opens a bunch of orders until the money runs out. So far I have created two functions for order counting. The first one counts buy orders and the second one counts sit orders... here is their code

// ФУНКЦИЯ ПОДСЧЁТА СВОИХ РЫНОЧНЫХ БАЙ ОРДЕРОВ 
   int CountBuy()
  {
   int count=0;
   for(int trade=OrdersTotal()-1;trade>=0; trade--)
     {
      OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magik_number)
        {
         if(OrderType()==OP_BUY)
            count++;
        }
     }
   return(count);
  }// КОНЕЦ ПОДСЧЁТА СВОИХ РЫНОЧНЫХ БАЙ ОРДЕРОВ 
   
   //-----------------
   
   // ФУНКЦИЯ ПОДСЧЁТА СВОИХ РЫНОЧНЫХ СЕЛЛ ОРДЕРОВ 
  int CountSell()
  {
   int count=0;
   for(int trade=OrdersTotal()-1;trade>=0; trade--)
     {
      OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magik_number)
        {
         if(OrderType()==OP_SELL)
            count++;
        }
     }

   return(count);
  }// КОНЕЦ ПОДСЧЁТА СВОИХ РЫНОЧНЫХ СЕЛЛ ОРДЕРОВ 



Let me explain, I pass an extern variable to the function above all the functions, so buy and sit orders have no input parameters...

After these two functions have been written, I create variables for calculating market buy and sell orders in OnTick. I first zero them out and then assign them to these functions that I wrote like this.

void OnTick()
  { // НАЧАЛО ОН ТИК
   int count_orders_market_buy = 0; // КОЛИЧЕСТВО РЫНОЧНЫХ БАЙ ОРДЕРОВ
    int count_orders_market_sell = 0; // КОЛИЧЕСТВО РЫНОЧНЫХ СЕЛ ОРДЕРОВ
     int count_orders_stop_buy = 0; // БУДЕТ КОЛИЧЕСТВО СТОП БАЕВ
      int count_orders_stop_sell = 0; // БУДЕТ КОЛИЧЕСТВО СТОП СЕЛОВ
      count_orders_market_buy= CountBuy();
      count_orders_market_sell = CountSell();

Then I open orders by on tick code with a condition that if a variable containing the number of orders is equal to 0. This is how I do it

   /*УСЛОВИЕ 1*/
   if(flag_screen1==en_vbIkl_screen1 &&flag_screen2==en_vbIkl_screen2)
   { // НАЧАЛО УСЛОВИЕ 1
   if(macd_buy!=EMPTY_VALUE && count_orders_market_buy ==0)
   {
    if(OrderSend(Symbol(),OP_BUY,lot,Ask,slippages,Ask-sl,Ask+tp , Coment)) Print("Buy Open"); // ОТКРЫВАЕМ БАЙ ОРДЕР
   }
   } // КОНЕЦ УСЛОВИЕ1

But a lot of orders are opened until we run out of money. Where is the error in the function or should I check somewhere else?

Reason: