Approaching a day line - how to find the direction?

 

Hello,


I wish to open a trade when I reach a day line, e.g. the top of the previos day. So, my time frame has to be daily. The problem is that I want to open it only once today, and only when I reach it from the bottom up. It shold be something like:


if (Bid == High[1] && ?? )

// open a trade


Any ideas?

 
aiv:

Hello,


I wish to open a trade when I reach a day line, e.g. the top of the previos day. So, my time frame has to be daily. The problem is that I want to open it only once today, and only when I reach it from the bottom up. It shold be something like:


if (Bid == High[1] && ?? )

// open a trade


Any ideas?

aiv,


to solve the 2nd part of your requirement, I suggest checking the previous close of a smaller time frame --- say the M1 time frame. Thus, the first time the Bid exceeds the previous days high and the close of the previous minute was below the previous days high, you know you are coming from the bottom. Additionally, you should also use a conditional-if with the OrdersTotal function to limit the number of trades that are opened pursuant to your two requirements


Also, I suggest revising your condition-if to read: if(Bid>=High[1] && ?? )


cheers

Reason: