I have never studied programming, but I want to write an EA - page 5

 
Sergey Lobzankin:

Dear Konstantin!!!
I understand it all. but i'm sorry guys, i can't afford to break the code completely. so you write a TS for the strategy and sell it? i asked for your advice, and i keep doing it

Are you serious?

It's all been written here for a long time, and any strategy has been rewritten five times over. I always remember the expression: "Everything new is long forgotten old".

You don't have to lay out the strategy, you can replace one indicator with another or simply substitute High[1] > Low[0] instead of the main condition.

 
Sergey Lobzankin:

Dear Konstantin!!!
I understand all that. but i'm sorry guys, i can't afford to lose the code completely. so you wrote the TS strategy and sold it? i asked for your advice and i continue to do so

Then it goes something like this

void  Trailig(double ATR)
{
  int stopLevel = (int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL)+1;
  for(int i = OrdersTotal()-1; i>=0; i--)
  {
    if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
    {
      if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic)
      {
        if(OrderType() == OP_BUY)
        {
          double stoploss = NormalizeDouble( (Bid - MathMax( TrailingStop, stopLevel)*Point), Digits);
          if(OrderStopLoss() < stoploss || OrderStopLoss() == 0)
          {
            if(StopLoss == SL)          // Параметры не известны, поэтому сказать ни чего не возможно
            {
              if(OrderStopLoss() == SL) // Параметры не известны, поэтому сказать ни чего не возможно
              {
                double takeprofit = NormalizeDouble( (Bid+MathMax( 3,stopLevel)*ATR),Digits);
                if(!OrderModify(OrderTicket(), OrderOpenPrice(), stoploss, takeprofit/*takeprofit*/, 0))
                  Print("Ошибка модификации ордера на покупку!");
              }
            }
          }
        }
      }
    }
  }
}

or analogue

void  Trailig(double ATR)
{
  int stopLevel = (int)SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL)+1;
  for(int i = OrdersTotal()-1; i>=0; i--)
  {
    if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
    if(OrderSymbol() != _Symbol) continue;
    if(OrderMagicNumber() != Magic) continue;
    if(OrderType() != OP_BUY) continue;
    
    double stoploss = NormalizeDouble( (Bid - MathMax( TrailingStop, stopLevel)*Point), Digits);
    if(OrderStopLoss() > stoploss && OrderStopLoss() > 0) continue;
    if(StopLoss != SL) continue;        // Параметры не известны, поэтому сказать ни чего не возможно
    if(OrderStopLoss() != SL) continue; // Параметры не известны, поэтому сказать ни чего не возможно
    double takeprofit = NormalizeDouble( (Bid+MathMax( 3,stopLevel)*ATR),Digits);
    if(!OrderModify(OrderTicket(), OrderOpenPrice(), stoploss, takeprofit/*takeprofit*/, 0))
      Print("Ошибка модификации ордера на покупку!");
  }
}
 
Konstantin Nikitin:

Then it goes something like this

or an analogue of

no offence.
almost figured it out.
of the code I cited the conditions are never, or almost never
copied from youtube, substituted my values and this is the result.
check, check and check again.

can I ask you a question? do you mostly sell robot signals? not manual trading?

 
Sergey Lobzankin:

Dear Konstantin!!!
I understand everything. but i'm sorry guys, i can't afford to lose the code completely. so you wrote the ts strategy and sold it? i asked for your advice and i continue to do so

Mr. Sergey, do you really think it is possible to surprise local programmers? They have already written all strategies several times in different variations and if they were to give so much money that it would be impossible to scorch... all programmers would be living on the sunny shore of their own island.

 
Alexey Viktorov:

Dear Sergey, do you really think that there is anything to surprise the local programmers? They have already written all strategies several times in different variations and if they were to give so much that cannot be scorched... all programmers would be living on the sunny shore of their own island.

There is no access to the Internet and mobile communication there, so everyone lives here - on the forum =)

 
Sergey Lobzankin:

I understand. I'm sorry guys, I can't afford to lose all the code. So you could write a strategy and sell it? I asked for your advice and I'm still doing it.

You are way overestimating your TS.

Until you show a real account with a year's worth of history, no one will want it.

 
Vitaly Muzichenko:

No internet or mobile phone access there, so everyone lives here - on the forum =)

So satellite is available everywhere...)))))

 
Vitaly Muzichenko:

There's no internet or mobile phone access, so everyone lives here - on the forum =)

So with that kind of money you could buy a generator and satellite connection - internet.

 
Sergey Lobzankin:

can i ask you a question? do you mainly sell robot signals? not manual trading?

All the signals are worked out by the experts. Even on MT5 although it does not show 100% algotrading, in fact it is 100%. This is a glitch in the local statistics calculation that considers position triggering on SL set by the Expert Advisor as manual trading.

 
Konstantin Nikitin:

*** SL trades triggered by the Expert Advisor are counted as manual trades.

To check this, it is worth looking at the magic number of trades that have been triggered by SL. If I'm not mistaken, they will have "0".

Reason: