[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5.
(The previous part here)
Hello, Could you suggest a function in mql4, which among several open buy positions, starting from the lowest price, counts the specified number of lots (sum) and outputs the price below which this number of lots are. Orders are market orders. And the same, but for sell.
To clarify, all orders with different number of lots. The function sums the orders in ascending OrderOpenPrice, as long as the condition "sum of lots <=sum" is correct.
What should this function return, the total number of lots, the difference between total and given number of lots or false-true depending on whether the actual value is higher or lower than the given one?
More precisely, what price are we talking about, the opening price of the last order if the volume is higher or equal to the specified one?
that's it...my pot is boiling....
if you remove the MEDIUM check from this code, the lines start drawing clearly.
If you return it to the way it is...the EA draws nothing at all!
who has seen an error? or the reason? please tell me.
the compiler shows no errors
Ma_1=iMA(NULL,PERIOD_H1,30,0,MODE_SMA,PRICE_CLOSE,1) ; Ma_2=iMA(NULL,PERIOD_H1,60,0,MODE_SMA,PRICE_CLOSE,1); if ( Hour()>=10 && Hour()<20) { if ( Ma_1>Ma_2) { SetVLine(Blue, "", 0, 0, 1);} }
that's it...my pot is boiling....
if you remove the MEDIUM check from this code, the lines start drawing clearly.
If you return it to the way it is...the EA draws nothing at all!
who has seen an error? or the reason? please tell me.
the compiler shows no errors
Show SetVLine();
Show SetVLine();
Should the function return the total number of lots, the difference between the total and the specified number of lots, or false-true, depending on whether the actual value is higher or lower than the specified one?
More precisely, what price are we talking about, the opening price of the last order if the volume is greater than or equal to a given volume?
Ma_1=iMA(NULL,PERIOD_H1,30,0,MODE_SMA,PRICE_CLOSE,1) ; Ma_2=iMA(NULL,PERIOD_H1,60,0,MODE_SMA,PRICE_CLOSE,1); if(TimeHour(iTime(Symbol(),0,0))>10&&TimeHour(iTime(Symbol(),0,0))<20) { if(Ma_1>Ma_2)SetVLine(Blue, "", 0, 0, 1); }
your code does not work!!! :)))))))))))))))) no lines are drawn.
and the time has nothing to do with it. The time is correct. I was outputting it on print...
And if instead of comparing to averages, put a comparison to stochastics - everything is clearly drawn.
Stoch_1=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_MAIN,1); Stoch_2=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_SIGNAL,1); if ( Hour()>=10 && Hour()<20) // if ( Ma_1>Ma_2) // убрал средние // { if (Stoch_1>Stoch_2) { SetVLine(Blue, "", 0, 0, 1);}
it looks likerigonich is boiling too :))))
just to be sure, I copied all the components from another working EA...
DID NOT DRAW!
changed "draw" to "buy and sell".
NOT WORKING!
it looks like MAGICAL BLEEP!
Printed out the averages both show 134, while their period differs by a factor of 20 (!)!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
(Previous part here)
Hello, Could you suggest a function in mql4, which among several open buy positions, starting from the lowest price, counts the specified number of lots (sum) and outputs the price below which this number of lots are. Orders are market orders. And the same, but for sell.
To clarify, all orders with different number of lots. The function sums the orders in ascending OrderOpenPrice, as long as the condition "sum of lots <=sum" is true.