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

 
BeerGod:

It closes all orders in the terminal and deletes all the pending orders with any mode, also on the screen shows the current situation in a small unobtrusive line at the top, as well as statistics in pips of closed orders. Installed and works like a normal Expert Advisor. The default setting is to close all at 5% profit. The settings can be changed through the menu of the Expert Advisor.


Thank you very much!!! I'm very uncomfortable being cheeky, but I can't help but ask this, is there any way to extract the close block from your EA so I can use it in any other EA? I apologise for my cheekiness.

I did not think about it right away, first of all I should have asked, and you do not mind if your advisor will be taken from the block?

 
xxxKillxxx:

Thank you so much!!! I'm very uncomfortable being cheeky, but I can't help but ask this, is there any way to extract a close block from your EA so I can use it in any other EA? I apologize for my impertinence.

Yes, please, the code is open source. All blocks in the code have comments.
 
BeerGod:

Yes, please, it's open source. All blocks in the code have comments.


Well thank you comrade, if suddenly my strategy comes true, I assure you, not without your help, and in case of profits, expect thanks)))
 
Good luck to you, too, in this difficult matter. If you need any help, please contact me.
 
BeerGod:

I would like to share my work with all my friends who are interested in this project. Installed and works like a normal Expert Advisor. The default setting is to close all at 5% profit. The settings can be changed through the menu of the Expert Advisor.


Comrade, excuse me again, but I have a problem.... I managed to check all blocks to close without any errors or warnings and I'm not getting any syntax, but I'm not getting any signals when I start my EA, my trades won't close as expected. The problem is that I can not put the code of the EA, and to solve the problem well very much needed, if you do not mind to spend on me again your precious time, please tell me what options may be to address the problem, if it is important, I can only say that the EA was created at forex generator 4.

I am thankful to you in advance.

 

There is a tool in mt - a linear regression channel, by drawing and referring to it I can get the start and end dates and prices. How do I access the boundaries of this channel?

 
xxxKillxxx:

Comrade, excuse me again, but I have a problem.... I managed to check all blocks to close without any errors or warnings and I'm not getting any syntax, but I'm not getting any signals when I start my EA, my trades won't close as expected. The problem is that I can not put the code of the EA, and to solve the problem well very much needed, if you do not mind to spend on me again your precious time, please tell me what options may be to address the problem, if it is important, I can only say that the EA was created at forex generator 4.

I would like to ask you to explain the reasons (preferably on your fingers and tongue-in-cheek, because I only do this kind of programming) Thanks in advance.


forex generator 4 ??? If you have created an owl using it, it will not work. Write at least something without the "navigator", and you will start to understand something. And explaining something to a person who hasn't written anything himself is not an option. You can only go here that way. You can ask clear questions, where something is not clear, and someone will answer. But to write code, then chew it up and put it in your mouth... I don't think so.
 

There was an owl that worked flawlessly. I decided to spread the code around expert и libraries.

Started to rebuild the structure. I've written libraries and header files for them. In the header files I have either external parameters (extern), or declarations of all functions of the corresponding library and that's it!

Reworked part of the Expert Advisor, compiled it. I pull it to the chart and ... I do not see any external parameters in the window.

Here is what I see:

This is what is in the Expert Advisor's header before INIT:

//+-------------------------------------------------------------------------------------+
//|                                                                       Perevorot.mq4 |
//|                                                                                 hoz |
//|                                                                                     |
//+-------------------------------------------------------------------------------------+
#property copyright "hoz"
#property link      ""

#include <hoz_Base@Include.mqh>
#include <hoz_MakeListOfInstruments@Include.mqh>
#include <hoz_TradingFunc@Include.mqh>

extern string ___H1 = " ________ Параметры общие _________ ";

extern string ___H3 = " _______ Параметры фильтров _______ ";

extern string ___H4 = " ________ Параметры ордера ________ ";
extern double  i_lot = 0.1,
               i_kLot = 2,
               i_sl = 0,
               i_tp = 10,
               i_distanceFromLastPos = 10;
extern string ___H5 = "____ Параметры функции безубытка ___";
extern bool    UseBU  = false;           // включение/выключение функции Б.У.
extern double  i_triggerForBU = 25,      // уровень цены, где выставляется уровень Б.У.
               i_preservedProfit = 5;    // страховочный профит в Б.У.
extern string ___H6 = "____ Параметры трейлинга позиции ___";
extern bool    TSProfitOnly = true;
extern int     TStop.Buy = 70;          // расстояние от текущего курса (пунктов), на котором включается трейлинг, пунктов
extern int     TStop.Sell = 10;         // расстояние от текущего курса (пунктов), на котором включается трейлинг, пунктов
extern int     TrailingStep = 20;       // "шаг" изменения стоплосса (пунктов) (не меньше 1)
extern string ___H7 = " _____ Параметры идентификации ____ ";
extern int     i_magic = 3333021;

// Другие объявленные переменные
datetime g_lastBarTime,                                         // Время проведения последних рассчётов
         g_lastOrderOpenTime;                                 // Время открытия последнего ордера
double SL,
       TP,
       priceBU;
int    massiveOfOrders[7],                                   // Массив ордеров
       g_ticket,
       g_type;

double lastPosOOP = -1;
int    lastPosType = -1;

#define SIGNAL_NO                            -1              // Сигнала нет
#define SIGNAL_BUY                            0              // Сигнал на покупку
#define SIGNAL_SELL                           1              // Сигнал на продажу

Why is there no tab of external parameters?

 

Hello! This is my first day of using Meta Trader 4 and I already have a lot of questions.

1) When I watched the training video on the global fots website, it tells me about the simplest trades. But it says that while I buy, stop loss should be lower than the left one and take profit higher. So, we predict what value the price will reach and the order will close on take profit. And if the value will fall, so as not to be in -, i.e. to lose money, we limit its stop loss. Let's assume the following: Price 1.3552/1.3555, stop loss 1.3522, take profit 1.3612. Now the direct question: Is it possible to make a stop loss of 0.0000? After all, the probability is very low that the value will reach such a minimum and we can just wait till the value jumps and finally reaches our take profit and anyway find ourselves in + without any predictions. P.S. I apologise if this is a very silly question. Again, first day using it, but it seems to me like some kind of cheese in a mousetrap.

2) My second point of interest is that when the chart goes up we buy, when it goes down we sell. How do you make profit when the chart has 1.3500 and we set everything to sell and eventually wait for even lower values, say 1.3400? I just do not understand, it is the same as buying milk for 50 rubles to sell it for 40.

P.S. I thank you in advance. Do not judge strictly))).

 
Yugin:

Let's assume the following: Price 1.3552/1.3555, stop loss 1.3522, take profit 1.3612. Now the direct question: Is it possible to make a stop loss of 0.0000?

How is it possible to make profit when the value is let's say 1.3500 and we set everything to sell and as the result we wait even lower than the value of let's say 1.3400? I just do not understand, it is the same as buying milk for 50 rubles to sell it for 40.

P.S. I thank you in advance. Do not judge severely)).


Eto basics of forex, learning them is not on this site. (kazhisya).

If you want to trade with an Asian broker, you have to do the same for all the other brokers. The SL cannot be 0.0000.

If you sell EURUSD with 1 lot, you will sell 10,000 EUR and buy 10,000 USD,

When this order is closed, selling of 10000 USD and buying of 10000 EUR. If EUR gets cheaper, you spend less to buy it again and earn more.