hello guys i tried learning how to write an Indicator, i must say am confused and tired ...am at the verge of giving up...guys if you can spare a minute or two to look into my code and encourage me, i will appreciate
I tried to make a pivot point indicator, but i don't know whats wrong, because its not displaying any lines but for the high[i] it showing lines.....
i dont know why i find it difficult learning how to do this but am a good programmer when it comes to Expert Advisors
hello guys i tried learning how to write an Indicator, i must say am confused and tired ...am at the verge of giving up...guys if you can spare a minute or two to look into my code and encourage me, i will appreciate
I tried to make a pivot point indicator, but i don't know whats wrong, because its not displaying any lines but for the high[i] it showing lines.....
i dont know why i find it difficult learning how to do this but am a good programmer when it comes to Expert Advisors
Documentation
Tutorial Book
Custom indicators
https://docs.mql4.com/customind
Creation of custom indicators
https://book.mql4.com/samples/icustom
Those pages above should help you with this problem.
- Jack
- docs.mql4.com
for(int i=prev_calculated; i<rates_total; i++){ double WeeklyHigh=NormalizeDouble(iHigh(NULL,PERIOD_W1,1),5);
There is no such function iHigh. Why did you post your MT4 question in the Root / MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum-
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
for(int i=prev_calculated; i<rates_total; i++){ double WeeklyHigh=iHigh(NULL,PERIOD_W1,1);
Unless you are running on the W1 chart, you are mixing apples and oranges. Your bar index is i but you are looking at the weekly 1 not the corresponding weekly index.
You declared buffers only for pp and s1.
yes, i stopped and got discouraged when i saw it wasn't showing any lines
Documentation
Tutorial Book
Custom indicators
https://docs.mql4.com/customind
Creation of custom indicators
https://book.mql4.com/samples/icustom
Those pages above should help you with this problem.
- Jack
Thanks jack, i already read most of those stuff, what i need is just someone to ask some qustions...like currently i need someone to show me my mistake with those piece of code above- why isnt it showing any lines on the chart.
- There is no such function iHigh.
Why did you post your MT4 question in the
Root /
MT5 Indicators section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum -
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
- Unless you are running on the W1 chart, you are mixing apples and oranges. Your bar index is i but you are looking at the weekly 1 not the corresponding weekly index.
1) No such function as iHigh(); really?
sorry about not posting the topic in the right section, i didnt know here is strictly for Mt5 indicators.
2)i will read that up, but if NormalizeDouble isnt used, there will be a warning message when i use the #property strict.
3)i didnt understand what you said there, remember, am learning how to write indicators on my own.
1) No such function as iHigh(); really?
sorry about not posting the topic in the right section, i didnt know here is strictly for Mt5 indicators.
2)i will read that up, but if NormalizeDouble isnt used, there will be a warning message when i use the #property strict.
3)i didnt understand what you said there, remember, am learning how to write indicators on my own.
Answers:
1) MQL4 has iHigh,iLow,IOpen,iClose, iTime
Read the documentation. It has the API specifications for each of item.
2) There is NOTHING wrong with using NormalizeDouble() if it is appropriate for the situation.
NormalizeDouble() is used for used for rounding numbers to a specific accuracy.
https://docs.mql4.com/convert/normalizedouble
Do you have specific questions about what you struggling with?
- Jack
- docs.mql4.com
hello jack, what i need now is just for someone to pin point my mistake in my code above though am not finish and no sign to show am making progress( no line displayed) i just became discouraged and lack interest to continue.
hello jack, what i need now is just for someone to pin point my mistake in my code above though am not finish and no sign to show am making progress( no line displayed) i just became discouraged and lack interest to continue.
I'm not going to do the work for you, but I am willing to help you learn how to fix it yourself.
You've not bothered to post any changes to your code, or explained what you did to try and fix it.
There are numerous programmers who can help you.
- www.mql5.com
hello guys still on that issue, i used the object create to create the lines but as usual there is a glitch, i notice that it doesn't work on all currency pair that is, it doesn't display lines and secondly, when i remove the indicator, the object is till on the chart.
Tomorrow, i will try to work on the indicator using the buffer the proper way.
i attached the indicator, any one that has a minute or two should go through it and help figure my mistake, because to me it looked perfect.
thanks.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello guys i tried learning how to write an Indicator, i must say am confused and tired ...am at the verge of giving up...guys if you can spare a minute or two to look into my code and encourage me, i will appreciate
I tried to make a pivot point indicator, but i don't know whats wrong, because its not displaying any lines but for the high[i] it showing lines.....
i dont know why i find it difficult learning how to do this but am a good programmer when it comes to Expert Advisors