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
What is “it?”
Be precise and informative about your problem.
Your OnCalcuate calculates the trend, but you do nothing with it. You must return a bar index, not trend.
What is “it?”
Be precise and informative about your problem.
Your OnCalcuate calculates the trend, but you do nothing with it. You must return a bar index, not trend.
I try to get the zigzag highs & lows by collecting_zz_values() , then classify highs at zzhigh and lows at zzlow.After the classification , remain empty arrays at each one(zzlow & zzhigh) ,so by DellArrayElement() I remove empty arrays.
Finally if the new high , lower than previous high & new low, lower than previous low, we have the bearish trend (trend==1)
and if the new high , higher than previous high & new low, higher than previous low, we have the bullish trend (trend==2) .
So if not, we cant detect the trend (trend==0).
Thanks a million.
I try to get the zigzag highs & lows by collecting_zz_values() , then classify highs at zzhigh and lows at zzlow.After the classification , remain empty arrays at each one(zzlow & zzhigh) ,so by DellArrayElement() I remove empty arrays.
Finally if the new high , lower than previous high & new low, lower than previous low, we have the bearish trend (trend==1)
and if the new high , higher than previous high & new low, higher than previous low, we have the bullish trend (trend==2) .
So if not, we cant detect the trend (trend==0).
Thanks a million.
I want that this indicator code , return the trend.
Can someone correct this indicator :
After the initial run (where prev_calculated is zero), prev_calculated equals rates_total, and your loop does nothing.
How to do your lookbacks correctly #9 — #14 & #19 (2016)
If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
I need HEEEELP, please, it's URGENT...really ! - General - MQL5 programming forum (2017)
Hire someone on Freelance.
Try replacing:
with:
and replace:
return rates_total;with:
and replace:
with:
and then insert into OnInit(), or OnCalculate():
The idea is to count "backward" without the need for prev_calculated.
By the way you'll also need an indicator handle, an ArraySetAsSeries, and a CoppyBuffer for each of your iMA calls. (You could share a single indicator handle among all 4 calls but the code is easier to follow if each call has its own.)Hello,
I'm looking for help and hope I'm at the right place in the forum.
I'm trying to modify a deal (#2 here below, volume 0.12) with PositionModify function of CTrade class :
trade.PositionModify(Ticket, newStopLoss, PositionGetDouble(POSITION_TP))
but I don't know why, the server is modifying all open positions (volume 0.3) and not only the 'ticketed' one.
The "bug" does not seem to be in the Trade.mqh because when I force the m_request.volume to 0.12, it does not help.
It looks like the bug is in the server side or in the configuration of the server...
Any help would be appreciated.
Thanks,
Rose
2025.03.08 20:22:20.696 2022.03.09 06:00:00 market buy 0.12 EURJPY sl: 125.848 tp: 129.248 (126.438 / 126.448 / 126.438)
2025.03.08 20:22:20.696 2022.03.09 06:00:00 deal #2 buy 0.12 EURJPY at 126.448 done (based on order #2)
2025.03.08 20:22:20.697 2022.03.09 06:00:00 deal performed [#2 buy 0.12 EURJPY at 126.448]
2025.03.08 20:22:20.697 2022.03.09 06:00:00 order performed buy 0.12 at 126.448 [#2 buy 0.12 EURJPY at 126.448]
2025.03.08 20:22:20.704 2022.03.09 06:00:00 CTrade::OrderSend: market buy 0.12 EURJPY sl: 125.848 tp: 129.248 [done at 126.448]
2025.03.08 20:22:20.704 2022.03.09 06:00:00 Open MagicNumber : 20250201
2025.03.08 20:22:20.704 2022.03.09 06:00:00 market buy 0.18 EURJPY sl: 125.948 tp: 130.548 (126.438 / 126.448 / 126.438)
2025.03.08 20:22:20.704 2022.03.09 06:00:00 deal #3 buy 0.18 EURJPY at 126.448 done (based on order #3)
2025.03.08 20:22:20.704 2022.03.09 06:00:00 deal performed [#3 buy 0.18 EURJPY at 126.448]
2025.03.08 20:22:20.704 2022.03.09 06:00:00 order performed buy 0.18 at 126.448 [#3 buy 0.18 EURJPY at 126.448]
2025.03.08 20:22:20.707 2022.03.09 06:00:00 CTrade::OrderSend: market buy 0.18 EURJPY sl: 125.948 tp: 130.548 [done at 126.448]
2025.03.08 20:22:20.707 2022.03.09 06:00:00 Open MagicNumber : 20250301
2025.03.08 20:22:20.709 2022.03.09 12:00:00 position modified [#2 buy 0.3 EURJPY 126.448 sl: 125.951 tp: 130.548]
2025.03.08 20:22:20.712 2022.03.09 12:00:00 CTrade::OrderSend: modify EURJPY (sl: 125.951, tp: 130.548) [done]