[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. - page 55
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
if((b_mod) && (priceB > Ask)) OrderModify(b_ticket,priceB,priceS,0,0,Brown);
if((s_mod) && (priceS < Bid)) OrderModify(s_ticket,priceS,priceB,0,0,Brown);
Here we should consider MarketInfo(Symbol(),MODE_STOPLEVEL) i.e.
priceB >= Ask+ MarketInfo(Symbol(),MODE_STOPLEVEL)*Point
priceS < =Bid- MarketInfo(Symbol(),MODE_STOPLEVEL)*Point
No. This question was already solved above. The function simply worked during the test on each tick and a new price was not obtained so quickly. But when the price did not change, the error occurred.
Well, if you pass elements to a function of type double orint, it can also do the same operations, but without any perversions. Why complicate your life?
If a function has a type, it is assumed that the function returns a value of that type.
Your function does not return anything.
No. This question has already been solved above. The function simply worked during the test on each tick and the new price was not obtained so quickly. But when the price did not change, the error popped up.
What do you mean no? If the condition
priceB >= Ask+ MarketInfo(Symbol(),MODE_STOPLEVEL)*Point
is not met and priceB >Ask (as in the code)
you will get an error.
In order not to modify the order when the price has not had time to change, we should enter the condition priceB!=OrderOpenPrice()
I would writeHour()>=18, and throw out the minutes altogether.
Can you advise whether it is possible to write an indicator that will draw lines in one timeframe, and the data for its drawing will be taken from another timeframe? The purpose: to visualize the re-drawing of the last bar.
It's elementary Watson... In each case, instead of Period() use PERIOD_M15 (the timeframe from which you want to receive data)... And put the indicator on the current chart. I.e., forcibly set the timeframe from which you want to take data.
It's elementary Watson... In each case, instead of Period() use PERIOD_M15 (the timeframe from which you want to get data)... And put the indicator on the current chart. That is, forcibly set the timeframe from which you want to take data.
It would be easy, if I was writing an Expert Advisor.
but there's an indicator. I haven't written them before.
I've looked at a standard stochastic as an example. I've read the indicator primer.
i have never read anything about periods. it seems to mean that bars are considered in the timeframe to which the indicator has been applied.
this is the reason of my question.....
This would be easy if I was writing an EA.
but there's an indicator. I haven't written them before.
I've looked at a standard stochastic as an example. I've read the indicator primer.
i have never read anything about periods. it seems to mean that bars are considered in the timeframe to which the indicator has been applied.
this is the reason for my question....
In standard stochastic:
double iStochastic( string symbol, int timeframe, int %Kperiod, int %Dperiod, int slowing, int method, int price_field, int mode, int shift)
If you write your own unique indicator, use int iBars( string symbol, int timeframe) instead of Bars
https://docs.mql4.com/ru/series/iBars
In a standard stochastic:
double iStochastic( string symbol, int timeframe, int %Kperiod, int %Dperiod, int slowing, int method, int price_field, int mode, int shift)
If you write your own unique indicator, use int iBars( string symbol, int timeframe) instead of Bars
https://docs.mql4.com/ru/series/iBars
the problem seemed easily solved.
replaced all Bars withiBars (viaint iB; iB=iBars("EUROUSD",PERIOD_M5);) No errors.
but no chart. An empty window appears.
Clearly something is missing.
Can the indicator draw 12 lines on one bar? Because there are 12 pentameters at 1 o'clock and each one draws its own line.
The problem seemed to be easily solved.
replaced all Bars withiBars (viaint iB; iB=iBars("EUROUSD",PERIOD_M5);) no errors.
But no chart. An empty window appears.
Clearly something is missing.
Can the indicator draw 12 lines on one bar? For example, there are 12 pentameters at 1 o'clock and each one draws its own line.
The same applies to Close - iClose, Open - iOpen, Time - iTime Volume - iVolume, etc.
The indicator may draw up to 8 lines from 0 to 7 https://docs.mql4.com/ru/customind/indicatorbuffers.