Please tell me how to get the time of the highest 5 minute TF candle during the last day only?? thank you for assist ..
- How to get Highest Low from Last 10 Candle???
- fail to call COG custom indicator
- hedging negative order
hadher ramadhan:
Please tell me how to get the time of the highest 5 minute TF candle during the last day only?? thank you for assist ..
What have you tried ?
Please tell me how to get the time of the highest 5 minute TF candle during the last day only?? thank you for assist ..
Alain Verleyen:
What have you tried ?
What have you tried ?
//--------------------------top1-------------------------------------------- int per=5; double top1=0.0; int top1_index=iHighest(NULL,per,MODE_HIGH,50,2); if(top1_index!=-1) top1=NormalizeDouble(iHigh(NULL,1440,1),Digits); else PrintFormat("Error in call iHighest. Error code=%d",GetLastError()); datetime T1=iTime(NULL,per,top1_index); //---------------------------bot1-------------------------------------------- double bot1=0.0; int bot1_index=iLowest(NULL,per,MODE_HIGH,50,2); if(bot1_index!=-1) bot1=NormalizeDouble(iLow(NULL,1440,1),Digits); else PrintFormat("Error in call iHighest. Error code=%d",GetLastError()); datetime T2=iTime(NULL,per,bot1_index); //--------------------------fib point-----------------------------------------i found the top and button of the last day but i cant find them times!!how to search the i Highest from the end of the last day to the start ??
What do you get, and what do you expect to get? Any Error?
Carl Schreiber:
What do you get, and what do you expect to get? Any Error?
What do you get, and what do you expect to get? Any Error?
i found top and bottun see the attached imag
Files:
Untitled.png
190 kb
//--------------------------top1-------------------------------------------- int per=5; double top1=0.0; int top1_index=iHighest(NULL,per,MODE_HIGH,50,2); if(top1_index!=-1) top1=NormalizeDouble(iHigh(NULL,1440,1),Digits); else PrintFormat("Error in call iHighest. Error code=%d",GetLastError()); datetime T1=iTime(NULL,per,top1_index); //---------------------------bot1-------------------------------------------- double bot1=0.0; int bot1_index=iLowest(NULL,per,MODE_HIGH,50,2); if(bot1_index!=-1) bot1=NormalizeDouble(iLow(NULL,1440,1),Digits); else PrintFormat("Error in call iHighest. Error code=%d",GetLastError()); datetime T2=iTime(NULL,per,bot1_index); //--------------------------fib point-----------------------------------------
- your png shows high and low of te previous day (..,1440,1)
- what is the value of T1 and T2?
Carl Schreiber:
- your png shows high and low of te previous day (..,1440,1)
- what is the value of T1 and T2?
that is my question how to get the time of the 5 minuit candles which is the highest or lowest on the last day only iwant to draw some triangls on it thank for replay
hadher ramadhan:
that is my question how to get the time of the 5 minuit candles which is the highest or lowest on the last day only iwant to draw some triangls on it thank for replay
that is my question how to get the time of the 5 minuit candles which is the highest or lowest on the last day only iwant to draw some triangls on it thank for replay
int iM5prvDayBegin = iBarShift( NULL,PERIOD_M5,iTime(Null,PERIOD_D1,1)), // first Bar m5 iM5prvDayEnd = iBarShift( NULL,PERIOD_M5,iTime(Null,PERIOD_D1,0)) -1; // last Bar m5
Now use iHighest and iLowest between those to indices.
hadher ramadhan: how to get the time of the 5 minuit candles which is the highest or lowest on the last day only
- Last day or current day? I assume last.
int top1_index=iHighest(NULL,per,MODE_HIGH,50,2);
This has nothing to do with your question.top1=NormalizeDouble(iHigh(NULL,1440,1),Digits);
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrongTotally unnecessary. Prices read are always normalized.- 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 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 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 forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 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.
- Since you are not running on the D1 chart, you must make sure the D1 is up to date. See Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum Then you can get the prices from the D1 chart (iHigh)
- But again this has nothing to do with your question.
- But you don't want that, you want the Time of the M5 candle (or its shift.) If the chart isn't the M5 #4 applies and use iHigh/iTime instead.
- Just use the time functions I posted yesterday.
#define COUNT uint INDEX iLOD = iBarShift(_Symbol, PERIOD_CURRENT, date() ) - 1; // Last bar yesterday INDEX iBOD = iYesterday(); // First bar yesterday COUNT nBars = iBOD - iLOD + 1; INDEX iHOD = iHighest(_Symbol, PERIOD_CURRENT, MODE_HIGH, nBars, iLOD); #define PRICE double string price_to_string(PRICE p){ return DoubleToString(p, _Digits); } PrintFormat("Yesterday's high of the day was %s at %s", price_to_string(High[iHOD]), (string)Time[iHOD]);
Draw rectangle around range of bars by hours
- 2017.05.15
- www.mql5.com
Hello This ought to be easy but I'm finding it fiendish. I want to draw a rectangle around my non-trading hours...
whroeder1:
- Last day or current day? I assume last.
- This has nothing to do with your question.
- Totally unnecessary. Prices read are always normalized.
- Since you are not running on the D1 chart, you must make sure the D1 is up to date. See Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum Then you can get the prices from the D1 chart (iHigh)
- But again this has nothing to do with your question.
- But you don't want that, you want the Time of the M5 candle (or its shift.) If the chart isn't the M5 #4 applies and use iHigh/iTime instead.
- Just use the time functions I posted yesterday.
wawo whroeder1 many many thanks it is really a great advise and a new knowledge for me i will read all the links you post above
Carl Schreiber:
Now use iHighest and iLowest between those to indices.
thank you very very match sir that is exactly what i m looking for !!!
I hop if there are a main topic for questions and answers which did not deserve to be a separate topic or stupid questions like mine
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