[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 693

 
Hedin:


In forex almost all servers are free.

And what's more, almost every brokerage house has demo accounts where you can trade with virtual money instead of real money.

Thanks, can you give me a specific link? I can't google it. Thanks again.
 
artmedia70:
What is a Margin CALL?
A Margin Call is a condition that results in a forced closing of a position.

This occurs when your account balance (Equity) has reached zero of the required margin (Margin) for the amount of all open positions.

The operation is automatic. In some companies the Margin Call is set at 30% of the Equity.

I.e. [AccountFreeMargin() = AccountEquity() - Margin] ?

where Margin -> total for all open positions.




 
Guest77:
Thank you, can you give plz a specific link? I cannot google it. Thanks again.

All you need to do is download and install MetaTrader 4 from any broker.

You need to open a demo account and you are ready to use it. Everything is free. You can find a broker through Google, there are lots of them.

 

Hello all. I have faced with a problem when writing an EA, I feel that the error is somewhere on the surface, but I cannot find it. I will be glad if somebody will tell me what to do.

The essence of the problem: I have been asked to add a trailing stop into one of Igor Kim' s EAs for several positions simultaneously. I added it all, but the result is bad :( Trailing stop always moves in TStop.Sell and TStop.Buy points away from bid and ask, i.e. price goes up, trailing stop also goes up, price goes down - trailing stop down... I don't need to call the telepathic team, I will add the code myself :)

int start()
{
 if(GetProfitOpenPosInCurrency(Symbol(),-1,MagicNumber)>=ProfitToStartTral) //если прибыль в валюте депозита больше заданной в настройках
    {
     CloseLoss(Symbol(),-1,MagicNumber);//закрываем все убыточные позы советника по текущему символу
     start3();//запускаем трал
    }
  //бла-бла-бла, тут еще куча рабочего кода :)
}

User-defined functions:

void start3() 
 {
  if (ShowComment) {
    Comment(IIFs(AllSymbols, "AllSymbols  ", "")
           ,"Magic="+IIFs(Magic<0, "Любой", DoubleToStr(Magic, 0))+"  "
           ,IIFs(TSProfitOnly, "TSProfitOnly  ", "")
           ,"TStop.Buy="+DoubleToStr(TStop.Buy, 0)+"п  "
           ,"TStop.Sell="+DoubleToStr(TStop.Sell, 0)+"п  "
           ,"TrailingStep="+DoubleToStr(TrailingStep, 0)+"п  "
           );
  } else Comment("");

  string sy=IIFs(AllSymbols, "", NULL);
  SimpleTrailing(sy, -1, Magic);
 } 
//*********************************************************************//
void SimpleTrailing(string sy="", int op=-1, int mn=-1) {
  double po, pp;
  int    i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
        po=MarketInfo(OrderSymbol(), MODE_POINT);
        if (mn<0 || OrderMagicNumber()==mn) {
          if (OrderType()==OP_BUY) {
            pp=MarketInfo(OrderSymbol(), MODE_BID);
            if (!TSProfitOnly || pp-OrderOpenPrice()>TStop.Buy*po) {
              if (OrderStopLoss()<pp-(TStop.Buy+TrailingStep-1)*po||OrderStopLoss()==0) {
                ModifyOrder(-1, pp-TStop.Buy*po, -1);
              }
            }
          }
          if (OrderType()==OP_SELL) {
            pp=MarketInfo(OrderSymbol(), MODE_ASK);
            if (!TSProfitOnly || OrderOpenPrice()-pp>TStop.Sell*po) {
              if (OrderStopLoss()>pp+(TStop.Sell+TrailingStep-1)*po || OrderStopLoss()==0) {
                ModifyOrder(-1, pp+TStop.Sell*po, -1);
              }
            }
          }
        }
      }
    }
  }
} 
//****************************************************
string IIFs(bool condition, string ifTrue, string ifFalse) {
  if (condition) return(ifTrue); else return(ifFalse);
}
 

I want to know if it is possible to pass the parameters specified in the indicator code (not the parameters of the indicator itself) to another indicator for processing?

The second question, how to pass parameters from the indicator to the EA and how this EA will behave in testing mode?

Thank you in advance!

 

You are explaining it in a very convoluted way.

The easiest way to transfer to MT via GlobalVariable is about like a clipboard. One puts the other takes it.

But, there are a lot of other options, they are situation-dependent. Since there is no situation, it's hard to talk about options. Itwill be tested on the same character.

 
zhuki:

You are explaining it in a very convoluted way.

The easiest way to transfer to MT via GlobalVariable is about like a clipboard. One puts the other takes it.

But, there are a lot of other options, they are according to the situation. Since there is no situation, it's hard to talk about options. It will be tested on the same character.


GlobalVariable is not found in MT help, ....

about the variants. For example, the calculation is as follows, there is a zigzag indicator, I added a code defining the patterns to the zigzag code, such as If (condition) if the condition is met, a =1 variable if it is not met, a=0. I need to pass this variable value to another indicator, in this case if the variable in such indicator was equal to (a=1) do the following, if a=0. This is about passing parameters between indicators.

and, respectively, in the same form to pass parameters from the indicator to the Expert Advisor. When I test it in the Strategy Tester, will the Expert Advisor load the indicator for calculation and pass the variable values to the EA? Or it will catch error as the variable is inaccessible because it is located in the indicator environment!

 

Same question. How do I transfer data from one non-standard indicator to another?

 
zhuki:

You are explaining it in a very convoluted way.

The easiest way to transfer to MT via GlobalVariable is about like a clipboard. One puts the other takes it.

But, there are a lot of other options, they are according to the situation. Since there is no situation, it's hard to talk about options. Itwill be tested on the same character.

You can't call it like the standard iMA by short name, for example?
 
Abzasc:
Can't you call it up like the standard iMA by short name, for example?

You can call it, there are no errors, but how to pass the parameter? I make a call, put the parameter in brackets (which I call), but in the response swearing such parameter does not exist in the indicator.
Reason: