[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 411
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The thing is that I was outputting all MA values in the loop, and all values are correct, i.e. all MA values for this period have been enumerated. But calculation is wrong in this place - range = (Ma1 - Ma2)/Point;
if(range > maxrange) maxrange = range;
Well, you need to check what is being input. Which variable values are involved in calculations?
In the MQLtutorial in the Standard Functions chapter in the Graph Operations section there is a function WindowHandle with the following description:" ... returns system descriptor of the window (window handle) containing specified graph".
Question: what does "window handle" mean (what is it) and what is it for?
P.S. In order not to clutter up the forum, thank you in advance for your answer
In the MQLtutorial in the Standard Functions chapter in the Graph Operations section there is a function WindowHandle with the following description:" ... returns system descriptor of the window (window handle) containing specified graph".
Question: what does "window handle" mean (what is it) and what is it for?
P.S. In order not to clutter up the forum, thanks in advance for the answer
Response:
window descriptor is a number.
a window descriptor is needed to manipulate a window
hello! problem with the code!!! i need the orders to open one by one sell, bay, sell etc., but the counting was done during the day, the next day by a new one, without considering the order of opening orders of previous day! that is a new day a new cycle! above code i think it should look like this! except that the EA does not open any order! can not understand what's wrong ...tell me if you know!!!
When you open a pending order, set an expiry time, say 23:59, the order will close by itself.
nt OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
hello! problem with the code!!! i need the orders to open one by one sell, bay, sell etc., but the counting was done during the day, the next day by a new one, without considering the sequence of opening orders of previous day! that is a new day a new cycle! above code i think it should look like this! except that the EA does not open any order! can not understand what's wrong ...tell me if you know!!!
And why should it open orders, especially if the history is empty. And learn how to insert code humanly, I don't like editing other people's posts.
How to add to this advisor
//+------------------------------------------------------------------+
//| CCI.mq4 |
//| Copyright 2012, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
extern double LotTrend = 0.1;
extern int TP=100;
extern int SL=250;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (OrderSelect(0,SELECT_BY_POS,MODE_TRADES)==False)
{
if (Bid>iMA(Symbol(),PERIOD_M15,100,0,1,4,0)
)
{
OrderSend(Symbol(),OP_BUY,LotTrend,Ask,0,Ask-SL*Point,Ask+TP*Point,0,0,0,Green)
}
if (Bid<iMA(Symbol(),PERIOD_M15,100,0,1,4,0)
)
{
OrderSend(Symbol(),OP_SELL,LotTrend,Bid,0,Bid+SL*Point,Bid-TP*Point,0,0,0,Green);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
1.To open a trade only on close of a candle.(When price crosses SMA)
Hello! I have one question concerning the indicators in MQL4 and I cannot completely understand it... For example, I have a simple fractal indicator:
If you compile it in this form, it starts to glitch when extending the left graph border and loading history and shows marks where they shouldn't be (see screenshot in the attachment). If we comment out a part of the code:
Then these glitches disappear... The same glitches appear when loading history, if you fill only "nonempty" elements of the indicator array and don't reset indicator value where there are no labels...
Why does this happen? Why, it turns out, is it necessary to recalculate the whole indicator when loading the history? And why do I have to null the values of "empty" elements of the array?
If the bars were indexed from left to right, at history loading the indexes of the bars would change, and the indicator would be incorrectly displayed without recalculation, then we would understand this glitch ... But in MT4 bars are indexed from right to left, so, when loading the history, the indexes of those bars that were previously there should have remained the same (and the indicator values, too), then why recalculate the indicator and where do these marker shifts come from?