Expert Advisors: eInTradePanel

 

eInTradePanel:

The eInTradePanel is a panel for manual trading, it has some useful functions. It needs the minimum space on the chart.

Two modes are supported:

Mode 1 (Fig. 1) - Open position with specified Stop Loss and Take Profit levels (in points).
Mode 2 (Fig. 2) - Placement of order with Stop Loss and Take Profit levels, dependent on position of the horizontal lines.

The mode 1 is used for market orders.

The mode 2 is used for pending orders. In this mode, the order placement button is shown instead of "Sell" and "Buy" buttons. The specified Price, Take Profit and Stop Loss levels are shown on the chart. By moving the lines, you can change the order parameters:

Author: Дмитрий

eInTradePanel

eInTradePanel

 
There was a bug with the expiration time setting. Fixed.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 

Integer:
 Торговая панель eInTradePanel. Альтернатива стандартному окну открытия ордера. 

Great! Thank you very much!

Idea, implementation, functionality - everything is 5 points! I can't even find anything to complain about. :) It would be good if the developers would make this alternative inbuilt.

Integer, any ideas for development? Are wishes accepted?

 
Great!!! Thanks!!!!
 
VladMih:

Great! Thank you very much!

Idea, implementation, functionality - everything is 5 points! I can't even find anything to complain about. :) It would be good if the developers would make this alternative inbuilt.

Integer, any ideas for development? Are wishes accepted?

We accept wishes, go ahead.

 

Gold-version for enlarged screen fonts.

I use 25% enlarged fonts (installed in the system), in this mode many programmes try to "get on the margins". Good that some with sources.... :)

Oh, by the way, a wish - to put the setting of colours in the ini-file, it is easier to tweak when the mood changes.... ;)

Well, it's just a trifle, you can not take it seriously.

But a serious wish is to create a panel in all charts at once (running the Expert Advisor on one chart, of course). Taking into account that the panel is made as a class - it is not too difficult. (A simple example is here).

Charts should be saved. By running an Expert Advisor on a chart, we deprive the chart of the possibility to run any other Expert Advisor on it. :(

Anyway, let our EAs be mutually polite.

Files:
 
MetaDriver:

A serious wish is to create a panel in all charts at once (running the Expert Advisor on one chart, of course). Given that the panel is made as a class, it is not too difficult. (A simple example is here)

I don't think it will work. You need to handle events. In the timer example all charts are checked for button pressed, and the timer works with an interval of a second, i.e. long, it will be inconvenient. Of course, it is possible to view other charts from the main looped EA, but I do not want to engage in left inventions, but use things for their purpose.

In the terminal, one chart with a panel is enough, the chart can switch the symbol.

 
Integer:

timer works with an interval of a second, i.e. long, it will be inconvenient. Of course, it is possible to view other charts from the main looped EA, but I do not want to do left inventions, and use things for their intended purpose.

to the issue of fast timer and "soft" looping

//------------------------------------------------------------------ OnInit
int OnInit()
{
  EventChartCustom(ChartID(), 1, 0, 0, "user_start"); // initialise the loop
}
//------------------------------------------------------------------ OnChartEvent
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{       
  /* event handling*/
        
  Sleep(10); // a short pause for unloading
        
  EventChartCustom(ChartID(), 1, 0, 0, ""); // loop the events
}
 
Integer:

1. I don't think it's gonna work. You need to process events. In the timer example, all charts are checked for button presses, and the timer works with an interval of a second, i.e. long, it will be inconvenient. Of course, you can view other charts from the main looped EA, but I don't want to do any left inventions, but use things as they are intended.

--

2. one chart with a panel is enough in the terminal, the chart can switch the symbol.

1. By making small changes:

.......
#property indicator_chart_window
.......
........

//void OnTick()
int OnCalculate(const int rates_total,const int prev_calculated,
                const datetime &Time[],const double &Open[],const double &High[],
                const double &Low[],const double &Close[],const long &TickVolume[],
                const long &Volume[],const int &Spread[])
{
   TradePanel.Tick();
   return 0;
}

EA turns into a normally (with two non-critical warrnings) compiled indicator.

Everything works for him, he has almost no health complaints. The only dysfunction is that it does not open orders, because it is not supposed to do so.... :)

It can be solved. The scheme is approximately as follows:

the Expert Advisor opens indicators on all (or only minute) charts, which are quite autonomous, only when it is necessary to open/change a position, it forwards the

event to the main Expert Advisor, which it does for them.

Subtleties:

1) the Expert Advisor, opening each indicator, passes to it as a parameter the ID of its chart, so that the indicator can generate an event addressing a specific chart.

2) When generating an event addressed to the Expert Advisor, the indicator should not forget to pass as a string parameter the symbol by which the position should be corrected or the order should be placed/corrected.

3) It is desirable that the Expert Advisor scans charts once every one/few seconds, checking for new minute charts, and launch new indicators if necessary,

nailing the unnecessary ones.

That's all. It takes an hour and a half, or even less.

ps. Oh yes, I missed (4) global variables. They can be multiplied without any problems - the ID of the chart is added to the variable name as a prefix.

--

2. That's really long.

 
SUPER!!!!!!Offiggeno!!!! nothing superfluous, everything is simple, everything is intuitive, without unnecessary contrivances!!!! +5 points for the product!!! I was just looking for position and order management with the help of lines, and found such a miracle!!!! Well done!!!!
 

Installed

It gives 5 errors and 2 warnings

How to fix it?

Files:
iud1kh57g0.jpg  107 kb