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

 
Vinin:


DC - Dealing Desk

In the tester for other instruments you can only get the opening price on the zero bar, ticks for other instruments are not modelled, the market environment is almost inaccessible.

Trades in other instruments are not opened.

If you need to correctly perform multicurrency analysis, it's better to use MT5. There is a multicurrency tester there.


Is it possible to trade in real accounts through MT5? Or is it only for demo accounts so far?
 
ViktorF:

Is it possible to trade in real accounts through MT5? Or is it only for demo accounts?

Some brokerage companies offer this service.
 
Help me please. I made up a small code, but there is an error with brackets... what's wrong?
//+------------------------------------------------------------------+
void line()
{
 ObjectCreate("MILINE", 1, 0, Time[0], Bid-5*Point);
 
 if (Bid<ObjectGet("MILINE", 1) 
 {
 ObjectSet("MILINE", 1, (ObjectGet("MILINE", 1)-1*Point));
 return;
   }
 
 
 if (Bid>ObjectGet("MILINE", 1)
 
 {
  ObjectSet("MILINE", 1, (ObjectGet("MILINE", 1)+1*Point));
 return;
   }
   //+------------------------------------------------------------------+
  }
 
143alex:
Ask me please. I made a small code, an error with parentheses appears... what's wrong?


Is it hard to calculate the brackets yourself? Or is it impossible to comment out a piece of code with an error?

//+------------------------------------------------------------------+
void line(){
 ObjectCreate("MILINE", 1, 0, Time[0], Bid-5*Point);
 if (Bid<ObjectGet("MILINE", 1)) { ObjectSet("MILINE", 1, ObjectGet("MILINE", 1)-1*Point); return; }
 if (Bid>ObjectGet("MILINE", 1)) { ObjectSet("MILINE", 1, ObjectGet("MILINE", 1)+1*Point); return; }
   //+------------------------------------------------------------------+
  }

ZS: all the same will not work - no check whether the object is created, no redrawing the window to check the creation of an object

 
IgorM:


Is it hard to calculate the brackets yourself? Or is it impossible to comment out a piece of code with an error?

HH: it won't work anyway - no checks to see if the object was created, no redrawing of the window to check if the object was created

Thank you! I'm just learning... I'll get to inspections someday.
 
143alex:
Thank you! I'm just learning... I'll get to inspections someday.
In the tester on the m-1 it works... very interesting for experiments on sharp movements. Thanks again!
 
 void Send_BUYLIMIT(double Lot,double cena)
{
if ( OrdersTotal()==0  ) OrderSend(Symbol(),OP_BUY,0.01,Ask,10,0,Bid+10*Point);
if (OrderType()==OP_BUY && OrdersTotal()<=4)OrderSend(Symbol(),OP_BUYLIMIT,Lot,cena,10,0,cena+tp*Point,0,123,0,Blue);
 
}
   return(0);


How can I open a buy order and set 4 pending bylimit orders? A total of 5 orders, 1 market order and 4 pending orders. What is the error here?

 

Hi all.

Can you tell me please: after testing on the history, is there any way to get the comment or magic number of each trade made, or any other way to identify the trades? Let me try to explain the meaning. Suppose I programmed a few patterns and ran the Expert Advisor on the history and, as it often happens, it fails. It would be interesting to see, which of the patterns and under what market conditions is losing more and more often, and which (if any) shows at least some profit.

Thanks in advance for the answers.

 
artmedia70:


Artemida70, thanks for the tip on finding errors when debugging the program.

I have a couple more questions, please answer as far as possible.

Question one. During testing I display technical information about level of slips, rate of trend growth etc. with the help of alerts. At the end of testing I am reviewing the journal with trades and technical information at the time of order opening. I review all entries in the log using the slider. It appears that information about the most recent trades is visible, while the very first trades and in the middle of the timeframe under test are not. Question: How may I view all the information within the whole period being tested?

Question two. On one of the closed forums I've seen a talk about the existence of a more complete book on the MQL4 language and also about a small manual or instruction for the MT4 terminal, which gives the key operators that allow to remove the Expert Advisor from trading, put it for testing, etc. in a programmatic way.

QUESTION: can you help in getting this information?

THANK YOU

 

I have created a custom indicator with the following external data:

//------- Параметры индикатора --------------------------------------+
extern datetime  Zero_Point      = D'2010.10.10 00:00';
extern int       cnt_Bars        = 0;
extern string    Lots            = "0.1";                            // Размеры лотов
extern string    BUY_Pairs       = "AUDJPY;AUDCAD;EURJPY;GBPJPY;GBPUSD;NZDUSD;CADJPY";
extern string    SELL_Pairs      = "AUDUSD;CHFJPY;EURCHF;EURUSD;GBPCHF;NZDJPY;USDJPY";
extern bool      CalculateInPips = False;

I call it from the EA:

string List = DSDig (MathMax (Lot, gd_Lot[gi_cur_Basket]));
        Print ("Zero_Point = ", Zero_Point, "; Lot = ", List, "; Basket Long = ", cur_Basket_Long, "; Basket Short = ", cur_Basket_Short);
        iCustom (Symbol(), TF_ind, "i-PSI@EquityBasket", Zero_Point, 0, List, cur_Basket_Long, cur_Basket_Short, False, 0, 0);

EA log:

20:13:54 e-PSI@BasketBull_v2.4 EURUSD,H4: Zero_Point = 1288915200; Lot = 0.10; Basket Long = USDJPY;USDCHF;CADJPY;CADCHF; Basket Short = NZDUSD;AUDCAD;EURJPY;EURGBP;AUDUSD;EURCAD;EURCHF;EURUSD

Here I have that the data is transmitted correctly.

Let's see the indicator log:

Basket LONG[8]: 0 - NZDUSD; 1 - AUDCAD; 2 - EURJPY; 3 - EURGBP; 4 - AUDUSD; 5 - EURCAD; 6 - EURCHF; 7 - EURUSD; 
Basket SHORT[7]: 0 - AUDUSD; 1 - CHFJPY; 2 - EURCHF; 3 - EURUSD; 4 - GBPCHF; 5 - NZDJPY; 6 - USDJPY; 
20:13:34 i-PSI@EquityBasket EURUSD,M30: List Lot = USDJPY;USDCHF;CADJPY;CADCHF
20:13:34 i-PSI@EquityBasket EURUSD,M30: Zero_Point = 0; Lot = 0.00

Zero_Point value in the EA:

extern datetime Zero_Point          = D'2010.10.10 00:00';
Transmit value equal to (from EA log)
Zero_Point = 1288915200

and we get 0 in the indicator. Can someone tell me what is the problem?