How can I allocate the second bar starting from 00:00 hour West European Time

 

Can anybody give me advice how I can allocate the second bar after midnight. For example in a 4 hour chart the chart that opens at 4:00.

Thank you,

 

D

I normally do this on a an H1 chart so I can transfer the EA to brokers in different time zones

so something like...

extern int StartHour=4;


start()

if ((Hour()==StartHour) && (Volume[0]==1)) // go for it on first tick of your new bar
{

   // Your code goes here


}

You can get data from other chart periods at any time

-BB-

 
BarrowBoy:

D

I normally do this on a an H1 chart so I can transfer the EA to brokers in different time zones

so something like...

You can get data from other chart periods at any time

-BB-

Thank you BB,


What i want is the High value of that bar and use it as an entry point, let say 10 pips above it. How do you connect the time to the bar?



regards,

D

 

Something like...

extern int StartHour=4;
extern int EntryAddPips=10;

start()  
{

double high_val, order_price;

if ((Hour()==StartHour) && (Volume[0]==1)) // go for it on first tick of the new bar
  {  
    high_val=High[iHighest(NULL,PERIOD_H1,MODE_HIGH,4,1)]; // highest of the last four H1 bars  

    order_price = high_val+EntryAddPips*Point;

  }

}
-BB-
 
BarrowBoy:

D

I normally do this on a an H1 chart so I can transfer the EA to brokers in different time zones

so something like...

You can get data from other chart periods at any time

-BB-

Thank you BB,


I have put the formula into my programm, see example. But it is not doing waht I want. It should only put an order in after 4:00 when the High or low is above below the order_priceHigh or Low.

I also attache the coplete formula.



regards,

D


int total = OrdersTotal();
double high_val, Low_val, order_priceHigh, order_priceLow;

if ((Hour()==StartHour) && (Volume[0]==1)) // go for it on first tick of the new bar



high_val=High[iHighest(NULL,PERIOD_H1,MODE_HIGH,4,1)]; // highest of the last four H1 bars
Low_val =Low[iLowest (NULL, PERIOD_H1,MODE_LOW,4,1)]; // lowest of the last four H1 Bars



order_priceHigh = high_val+EntryAddPips*Point;
order_priceLow = Low_val - EntryAddPips*Point;


if( total < 1 && High[0] > order_priceHigh )res=OP_BUYSTOP;
if( total < 1 && Low[0] < order_priceLow)res=OP_SELLSTOP;

Files:
 
> But it is not doing waht I want. Well it wont will it ;) -- try -- if (Hour()>=StartHour) { if(( total order_priceHigh)) res=OP_BUYSTOP; if((total
Reason: