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

 
Locost:
Good evening. I`d like to know if I`ve started in the right direction? I've installed the GranCapital program and made micro account. I'm playing on the demo account now. I'm still trying to learn.


The question is what?

You have to read up on various indicators and so on in the help so that you don't trade by gut feeling. So you have to learn.

 

Can you tell me how the last order in the history was closed? At Stop Loss or Take Profit?

And ...

Why does it check if order is open

If(OrdersTotal() > 0 ) return(0);

Just place 1 more order and that's it, what is the problem ?

 
Can you please tell me how to position objects on a chart where there can be several candlesticks in one minute (for example, small rangebars)? As far as I understood from the documentation, the time in MT4 is considered with a minimum step of 1 minute, and the objects are attached to the chart using time coordinates. Thank you in advance!
 

Hello, The MACD indicator on the chart shows five digits after the decimal point but in the EA for example double MACD=iMACD(======) calculates four digits, how to solve the problem and have the iMACD calculate five decimal points in the EA.

 
kakbutak:

Hello, The MACD on the chart shows five digits after the decimal point but in the EA for example double MACD=iMACD(======) calculates four digits, how can I solve the problem, so that the iMACD in the EA calculates five decimal points.

Read documentation

It prints some message to the EA log.

Data of type double is printed with 4 decimal digits after the point.

 
ilunga:

read the documentation

Prints some message to the expert log.

Data of type double is printed with 4 decimal digits after the point.


Thank you.
 
drknn:


In the tester, the history of EurUsd is loaded until the year 2010 and it starts its tests from there. And it doesn't load the history for your cross, so it does not show the necessary one. Moreover, all the alerts in the tester are written to the log.

P.S.

Well this is just as 1 possible option....

set it on the chart!!! works...! will try and work it out with the tester!

thanks for the help!)

 

Guys, tell me where in the MT4 settings (or in the settings file) to set/increase the allowable number of characters in the "Name" and "Text" fields of the text location (Object List Ctrl+B)?

/if it's not too much trouble, can you reply to me by email: maxig.pro@gmail.com
/ thank you/

 
fmillion:

Can you tell me how the last order in the history was closed? At Stop Loss or Take Profit?

And ...

Why does it check if order is open

If (OrdersTotal() > 0 ) return(0);

Just put 1 more order and that's it, what's the problem ?


Put this address on your browser's "button". There you will find answers to all such questions:

https://www.mql5.com/ru/forum/131859

E.g. Page 4
GetTypeLastClosePos - Return type of last closed position or -1
GetTypeLastOpenPos - Return type of last open position or -1
isCloseLastPosByStop - Returns the flag of the last position closed by Stop
isCloseLastPosByTake - Returns the flag to close the last position by Take.
isLossLastPos - Returns the flag of loss of the last position.
isTradeToDay - Returns the flag of trading today
NumberOfBarCloseLastPos - Returns the close number of the last position or -1.
NumberOfBarOpenLastPos - Returns the bar number of the last position opened or -1.
NumberOfLossPosToday - Returns the number of losing positions closed today.
PriceCloseLastPos - Returns the closing price of the last closed position.

 

 

granit77

I disagree. No need to go beyond mql, no need to remove the EA from the chart. It is enough to programmatically block trading by providing this in the EA code.

Zhunko:
Yes! Right! Exception only for remote control.

Thanks for the feedback, but I still don't know which is better and I have chosen:

PostMessageA(WindowHandle(Symbol(),Period()), WM_COMMAND, 33050, 0);

Now I have another question. What should I add to the code, so that it will not go off immediately, but after a certain amount of triggering (e.g.:Kol=3)

#property show_inputs
#include <WinUser32.mqh>
extern int Kol=3;

int start()
      {
   OrderSend(Symbol(),OP_SELL,0.05,Bid,333,0,0,"Тест",0,0,CLR_NONE);
   while(!IsTradeAllowed()) Sleep(1000);
   PostMessageA(WindowHandle(Symbol(),Period()), WM_COMMAND, 33050, 0);
return(0);
      } 

Thanks in advance

Reason: