[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 698

 
valenok2003:

copyright
string copyright = "\xA9";
 
ToLik_SRGV:

thank you
 
Again, I come back to the question I asked https://forum.mql4.com/ru/15972/page693 - here, parameter transfer between indicators and indicators - experts. Of course, the proposed use of global variables partially solves this problem, but another question arises! According to the description of global variables ......... A GV variable can only be of the double type, but how do we expect the Expert Advisors to know if the variable is received from a certain symbol and timeframe when receiving the value of a global variable ?
 
Infinity:
Again, I return to the question I asked https://forum.mql4.com/ru/15972/page693 - here, parameter transfer between indicators and indicators - experts. Of course, the proposed use of global variables partially solves this problem, but another question arises! According to the description of global variables ......... A GV variable can only be of the double type, but how do we expect the Expert Advisors to know if the variable is received from a certain symbol and timeframe when receiving the value of a global variable?

Encode the symbols. Although it is possible to use variable names for this purpose, for example EUSRUSD_H1_Var1
 
cyclik33:


Made in the Gorando program, with the addition of your martin.

//+------------------------------------------------------------------+
//| Copyright 2005, Gordago Software Corp. |
//| http://www.gordago.com/ |
//| version 2.0 |
//+------------------------------------------------------------------+




void OpenBuy() {
double dStopLoss = 0, dTakeProfit = 0;
double Lots_New = Lot;

if (isLossLastPos(NULL, -1, MAGIC))
Lots_New *= 2;
else if (!isLossLastPos(NULL, -1, MAGIC))
Lots_New = Lot;


if (dBuyStopLossPoint > 0)
dStopLoss = Bid-dBuyStopLossPoint*Point;

if (dBuyTakeProfitPoint > 0)
dTakeProfit = Bid + dBuyTakeProfitPoint * Point;

int numorder = OrderSend(Symbol(), OP_BUY, Lots_New, Ask, nSlippage, dStopLoss, dTakeProfit, sNameExpert, MAGIC, 0, colorOpenBuy);

if (numorder > -1 && lFlagUseSound)
PlaySound(sSoundFileName);
}

void OpenSell() {
double dStopLoss = 0, dTakeProfit = 0;
double Lots_New = Lot;

if (isLossLastPos(NULL, -1, MAGIC))
Lots_New *= 2;
else if (!isLossLastPos(NULL, -1, MAGIC))
Lots_New = Lot;

if (dSellStopLossPoint > 0)
dStopLoss = Ask+dSellStopLossPoint*Point;

if (dSellTakeProfitPoint > 0)
dTakeProfit = Ask-dSellTakeProfitPoint*Point;

int numorder = OrderSend(Symbol(),OP_SELL, Lots_New, Bid, nSlippage, dStopLoss, dTakeProfit, sNameExpert, MAGIC, 0, colorOpenSell);

if (numorder > -1 && lFlagUseSound)
PlaySound(sSoundFileName);
}

You have

void OpenBuy() {

double dStopLoss = 0, dTakeProfit = 0;
double Lots_New = Lot;

if (isLossLastPos(NULL, -1, MAGIC))
Lots_New *= 2;
else if (!isLossLastPos(NULL, -1, MAGIC))

Lots_New = Lot;

Is a function and at the very beginning of this function you assign the value = Lot to the Lots_New variable;

Think about how it will change afterwards if you always bring it back to its original state?

Where did I tell you to write it? In the external variables before the start function...

And normalize the lot value to the correct size:

Lots_New = NormalizeLot(Lot*2, False, "");

//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 16.05.2008                                                     |
//|  Описание : Возвращает нормализованное значение торгуемого лота.           |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    lo - нормализуемое значение лота.                                       |
//|    ro - способ округления          (   False    - в меньшую,               |
//|                                        True     - в большую сторону)       |
//|    sy - наименование инструмента   ("" или NULL - текущий символ)          |
//+----------------------------------------------------------------------------+
double NormalizeLot(double lo, bool ro=False, string sy="") {
  double l, k;
  if (sy=="" || sy=="0") sy=Symbol();
  double ls=MarketInfo(sy, MODE_LOTSTEP);
  double ml=MarketInfo(sy, MODE_MINLOT);
  double mx=MarketInfo(sy, MODE_MAXLOT);

  if (ml==0) ml=0.1;
  if (mx==0) mx=100;

  if (ls>0) k=1/ls; else k=1/ml;
  if (ro) l=MathCeil(lo*k)/k; else l=MathFloor(lo*k)/k;

  if (l<ml) l=ml;
  if (l>mx) l=mx;

  return(l);
}
 
Vinin:

Codify the symbols. Although, we can use variable names for this purpose, e.g. EUSRUSD_H1_Var1


Right! Thank you! But it's still not clear... It turns out that in the indicator I have to write all variable names, corresponding to the whole number of possible symbols. And if I want to pass a parameter from the indicator at some predefined moment, I will have to write the symbol definition code of the indicator. And then using comparisons or other functions of case type, I will determine which named global variable to write the parameter to! I understand it all correctly! ?

And here is another rhetorical question, or just to learn your opinion. There are so-called "patterns" in the nature of analysis. Patterns are nothing more than patterns based on certain repeating moments (or parameters). But unfortunately the market is an unstable substance, so every pattern can to some extent be treated as an inexact pattern, or a little deviate from certain parameters, being loyal to the formation of the pattern. If we take any timeframe, for example 15 minutes, as the base of analysis, we will see that there will be a certain amount of patterns on it appearing at certain conditions. Some number of situations when a pattern is not formed but these situations are close to the formation of the pattern, they just do not fit some definite parameters (they deviated a bit). This situation could have been avoided by sensible conditions of pattern forming. In this case there would be more patterns and more possibilities to enter the market, but the number of false patterns would increase because the parameters weren't specified strictly. (If we consider that with strict parameters the pattern can even not appear within a day with these conditions).

Question! With what parameters (hard condition or soft condition) should I use to form a pattern!

 

Help me solve a problem !


I search for orders which are open or pending. If they are available, then I determine which order is buy or sell. Under certain conditions (if one is bigger than the other or smaller than the third), I want to close this order. Change its parameters and open it again.

The problem is that there is always a signal to close the order and to open it. That is why my order closes, then opens again, and so on, opens and closes ... )))

How to fix this problem ? Ga


 
Infinity:


Exactly! Thank you! But it's still not clear. It turns out that in my indicator I will need to prescribe all variable names, corresponding to the whole number of possible characters. And if I want to pass a parameter from the indicator at some predefined moment, I will have to write the symbol definition code of the indicator. And then using comparisons or other functions of case type, I will determine which named global variable to write the parameter to! I understand it all correctly! ?

And just a rhetorical question, or just to get your opinion. There are so-called "patterns" in the nature of analysis. Patterns are nothing more than patterns based on certain repetitive moments (or parameters). But unfortunately the market is an unstable substance, so every pattern can to some extent be treated as an inexact pattern, or a little deviate from certain parameters, being loyal to the formation of the pattern. If we take any timeframe, for example 15 minutes, as the base of analysis, we will see that there will be a certain amount of patterns on it appearing at certain conditions. And there will be some situations when the pattern is not formed but these situations are very close to the formation of the pattern, they just do not fit some certain parameters (they deviated a bit). This situation could have been avoided by sensible conditions of pattern forming. In this case there would be more patterns and more possibilities to enter the market, but the number of false patterns would increase because the parameters weren't specified strictly. (If we consider that with strict parameters the pattern can even not appear within a day with these conditions).

Question! With what parameters (hard or soft condition) should I use to form a pattern!

You can do this with parameters, but not with patterns. You have to define the criteria first. Similar, not similar. And if it is similar, then to what extent. At least by how much (percents). In one case the time component, in the other - the price one. How to correlate them with each other. Although I can attach a neuronics layer. The Kohonen layer does a good job with that
 

Help me solve a problem !


I search for orders which are open or pending. If they are available then I determine which order is buy or sell. Under certain conditions (if one is bigger than the other or smaller than the third), I want to close this order. Change its parameters and open it again.

The problem is that there is always a signal to close the order and to open it. That is why my order closes, then opens again, and so on, opens and closes ... )))

How to solve this problem ? Ga
 
Necron:
Roger, thanks, but it still doesn't work correctly. Tried another trawl, but the error is still there :( Is there any difference between trailing one pose and trailing several at the same time?

I get it, you define variable ro at the beginning of the function, but you don't assign it anywhere, i.e. it's 0.