[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 550

 
danilakoks:
Can you advise an EA to place a pending order on the parabolik SAR indicator and trawl it accordingly... thanks

There are many Expert Advisors in CodeBase that work with this indicator. Search at the top right. Good Luck!
 
Equilibrium:

Thank you very much)), order closing works, no errors, but criteria does not work as expected again((, code and screenshot attached, Help please...
if (M_2 < S_2 && M_1>=S_1) 
      { 
       if (Total>0)
         {
          Close_Order (Lts,Tip);
         } 
       if (Total==0 тут критерий не сработает, так как переменная Total еще равна предыдущему значению, т.е. 1 и ордер открываться не будет
				 нужно использовать OrdersTotal() или перерассчитывать ее

       
         {                                          
          Open_Order_B (Lts);     
         }                                      
      }
   if (M_2 > S_2 && M_1<=S_1 ) 
      { 
       if (Total>0)
          {
           Close_Order (Lts,Tip); 
          }
       if (Total==0)         то же самое
          {                                          
           Open_Order_S (Lts);                                               
          }


At a glance, what I see in the function of closing orders, you need to select the order by the ticketOrderSelect(Ticket, SELECT_BY_TICKET), the number of lots indicate not the variable Lts, because it is recalculated every time, but use OrderLots() And another thing, you keep working on the 0 bar, respectively, the criteria on one bar may disappear, your orders may not open where you would like. Replace bar 0 with 1 and 1 with 2 in the indicator parameters


 
borilunad:

Who is obliged to do 5,000? Start with 100, test yourself, your broker and then decide with confidence! The money is yours!

I've been doing fine on a small depo for half a year now! Everything is right :)
 
Beowulf:

The small depot has been fine for half a year now! All's fair as it should be :)
If everything's OK, then throw in $2,000 and work for another six months. And then you'll see the results.
 
All computers have META TRADER logged into the account, but only mine doesn't work :-( maybe someone can tell me what can be done? maybe something to install additionally. i just don't want to reinstall vin... I even uninstalled the firewall, i thought it was the problem, i reinstalled the program 20 times... MarketTrader is working without any problems, I would like to work with Metatrader!
 
kolospav:
All computers have META TRADER logged into the account, but only mine doesn't work :-( maybe someone can tell me what can be done? maybe something to install additionally. i just don't want to reinstall vin... I even uninstalled the firewall, i thought it was the problem, i reinstalled the program 20 times... I had no problems with MarketTrader, I would like to run Metatrader!
Where is this computer located? For example, at home MT4 connects to the server fine, but at work it does not.
 

Good afternoon! I don't even know how to write it. It's my own function that I forgot. Yes even in version 5 Could someone please clarify it? How to implement it on fours?

double GetLot(  double Riskk,  ENUM_ORDER_TYPE  action ,  string  symbol ,   double  price ,  double   Lott  ){ 

                     double  volume=1,margin=1; 

                       if(use_percent_of_deposit) return  (Lot) ; MqlTick last_tick;SymbolInfoTick(Symbol(),last_tick);

                                                                                   switch(action)

     {

      case ORDER_TYPE_BUY: price=last_tick.ask ;

      case ORDER_TYPE_SELL: price=last_tick.bid ;

      case ORDER_TYPE_BUY_LIMIT: price=price;

      case ORDER_TYPE_SELL_LIMIT:  price=price;

      case ORDER_TYPE_BUY_STOP:  price=price;

      case ORDER_TYPE_SELL_STOP:  price=price;

      case ORDER_TYPE_BUY_STOP_LIMIT:  price=price;

      case ORDER_TYPE_SELL_STOP_LIMIT:  price=price;}

                     OrderCalcMargin(

         action,           // тип ордера

                  symbol,           // имя символа

                  volume,           // объем

                  price,            // цена открытия

                 margin            // переменная для получения значения маржи

                   ); 

         

         double  Koeffitsyenta=AccountInfoDouble(ACCOUNT_BALANCE)/ margin ;

         Lott= (Koeffitsyenta*Riskk)/100;

         double Shag=1/SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP); 

          Lott= Lott*Shag; Print( "Lot*Shag  " ,  Lot   );

         Lott=NormalizeDouble(Lot,0); 

          Lott= Lott/Shag;

         double MAX=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX);

           double MIN=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);

          if (Lot>MAX) Lot=MAX;if (Lot<MIN) Lot=MIN;

          return(Lot);

                 

                   }
 

Please advise how to calculate the value of custom indicator in the code, somehow it does not work

double osma1=iCustom(NULL, 0, "OsMA",12,26,9,0,1);

can't figure out what's wrong

 
Show in code what you are doing?
 
kwadrad:

Please advise how to calculate the value of custom indicator in the code, somehow it does not work

double osma1=iCustom(NULL, 0, "OsMA",12,26,9,0,1);

can't figure out what's wrong


Not enough information in the question. Reread it. And check everything.