Collecting Statistic : Hourly Candles

 

Hi All,

I need a script to tell me the statistic of if the day is bull candle, the hours (as in the time) of hourly candle that close above the opening price for that day and over a few days.

for bear candle, the hourly candle that close below the open price of that day.

anyone can help me?

 
Where is the problem?
 
zzuegg:
Where is the problem?


help me code?
 
doshur:


help me code?
Here: https://book.mql4.com// and : https://docs.mql4.com//
 


i know how to code but i have a mental block on how to go about doing it. appreciate if someone can help me with the skeleton part
 
doshur:
help me code?
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
so let discuss how to write our the script?
 
No, YOU write the script. THEN if you're having problem YOU post the script and your questions. We're not going to code it FOR you.
 

Build static variables or arrays depending what kind of statistic you need

Loop trough all candles

for each candle do the math

When loop is finished, evaluate

 
zzuegg:

Build static variables or arrays depending what kind of statistic you need

Loop trough all candles

for each candle do the math

When loop is finished, evaluate



yup, i thought of that but when fri close early, the time hour screw me up. so i kinda stuck how to proceed.

holiday close early too.

btw, im using fxdd account.

 

Life would be so much easier if the market traded 24/7/365 . . . but it doesn't so you have to use your intelligence, ingenuity and cunning to code around it.

For example (and I'm going to look stupid if this is wrong) . . . how to find the last bar (H1) of the last week regardless of the TimeZone that the Broker is on ?

datetime Sat10am = TimeCurrent() - (TimeCurrent()% (PERIOD_D1*60)) + 1 + (10 * PERIOD_H1 * 60 ) - ((TimeDayOfWeek(TimeCurrent() - (TimeCurrent()% (PERIOD_D1*60)) + 1) + 1) * PERIOD_D1 * 60) ;

int WeekLastBar = iBarShift(NULL, PERIOD_H1, Sat10am);