Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
int HHbar = iHighest(Symbol(),5, MODE_HIGH, length, atBar); int LLbar = iLowest(Symbol(),5, MODE_LOW, length, atBar); double HH = High[HHbar]; // iHigh(NULL,0, HHbar) double LL = Low[LLbar]; // iLow(NULL,0, LLbar)
You are getting the shift for the M5 TF then using that shift for the current chart TF
You are getting the shift for the M5 TF then using that shift for the current chart TF
Hello Keith,
do you mean that?
datetime today1=D'09.01.2019 04:00:00';
datetime today2=D'09.01.2019 06:00:00';
datetime start_day = (today1);
datetime end_day = (today2);
int fromBar = iBarShift(Symbol(), 5, start_day);
int atBar = iBarShift(Symbol(), 5, end_day);
int length = fromBar - atBar + 1;
int HHbar = iHighest(Symbol(),PERIOD_CURRENT, MODE_HIGH, length, atBar);
int LLbar = iLowest(Symbol(),PERIOD_CURRENT, MODE_LOW, length, atBar);
double HH = High[HHbar]; // iHigh(NULL,0, HHbar)
double LL = Low[LLbar]; // iLow(NULL,0, LLbar)
double OrdBuy=HH;
double OrdSell=LL;
but how can I automate the search for the maximum (and the minimum) every day from 4 to 6 in the morning?
Keith Watford:
When you post code please use the CODE button (Alt-S)!
You are still mixing TF
You are still mixing TF
datetime today1=D'09.01.2019 04:00:00'; datetime today2=D'09.01.2019 06:00:00'; datetime start_day = (today1); datetime end_day = (today2); int fromBar = iBarShift(Symbol(), 5, start_day); int atBar = iBarShift(Symbol(), 5, end_day); int length = fromBar - atBar + 1; int HHbar = iHighest(Symbol(),PERIOD_CURRENT, MODE_HIGH, length, atBar); int LLbar = iLowest(Symbol(),PERIOD_CURRENT, MODE_LOW, length, atBar); double HH = High[HHbar]; // iHigh(NULL,0, HHbar) double LL = Low[LLbar]; // iLow(NULL,0, LLbar) double OrdBuy=HH; double OrdSell=LL;
You are still mixing TF
I understood, sorry.
- 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, I'm trying to fix my entry price between the maximum (or minimum) of the candles registered between 4 am and 6 am. I tried anything but the platform does not do anything.
I tried to write these lines:
No error comes out of me but it does not work.
Can someone give me the solution so I can get it updated day by day?