Experts: DoubleMA Crossover EA

 

DoubleMA Crossover EA:

Trailing, pending orders. Signals of two indicators (Moving Average, MA). Trades only during a certain period of the day.

DoubleMA Crossover EA

Author: Vladimir Karputov

 
Good afternoon. Could you please tell me what the BreakOutLevel parameter is responsible for? And how is the traillin system implemented, it has three levels? I can't figure it out. Thanks in advance.
 
GRS:
Good afternoon. Could you please tell me what the BreakOutLevel parameter is responsible for? And how is the traillin system implemented, it has three levels? I can't figure it out. Thanks in advance.

You know, all the codes are a mystery for me too :)

When you have questions, you should start studying the code.

 
Vladimir Karputov:

You know, all the codes are a mystery to me too :)

When you have questions, you have to start studying the code.

:))) Could you give me a hint, at least on BreakOutLevel? I can deal with trailing myself (eh, the freebie didn't work out).

 
BreakOutLevel- Start trade after breakout is reached- the words seem clear, but the meaning slips away.
 
GRS:

:))) Please, at least on BreakOutLevel. I can deal with trailing myself (eh, the freebie didn't work out).

input ushort               BreakOutLevel     = 45;          // Start trade after breakout is reached

Literally: "Start trading after breakout" of so many points.

 
Vladimir Karputov:

Literally: "Start trading after the breakout" of so many points.

Vladimir, I translated this phrase, what does "after the breakout" mean?

 
GRS:

Vladimir, I translated this phrase, what does "after the breakthrough" mean?

"Breakthrough" implies that there is a line (level) and someone and something has broken through (crossed) that line (level).

 

Looked at the code.

"BreakOutLevel" is the indent from the current price to the price of the pending order.

For example, we place "SellStop" at the price"ShortTradeRate", which is equal to the current price minus the indent ("BreakOutLevel" is multiplied by the value of one point of the instrument, for example, for EURUSD it is something like 45*0.00001).

void OpenSellStopOrder()
  {
   double myStopLoss=0,myTakeProfit=0;
   double ShortTradeRate=m_symbol.Bid()-BreakOutLevel*m_adjusted_point;
   if(StopLoss>0)
      myStopLoss=ShortTradeRate+StopLoss*m_adjusted_point;
   if(TakeProfit>0)
      myTakeProfit=ShortTradeRate-TakeProfit*m_adjusted_point;
   if(m_trade.SellStop(lotMM,ShortTradeRate,NULL,
      m_symbol.NormalizePrice(myStopLoss),
      m_symbol.NormalizePrice(myTakeProfit)))
     {
 
Thank you very much, it's all sorted now.
 
GRS:
Thank you very much, now I've figured it out.

It is not always possible to adequately rename variable names - that's why such mishaps occur.