int seconds=45;
if(TimeCurrent()-Time[0]<=seconds)
{
//Do Something;
}
Like what about checking the order pool for orders taken from the current bar?
if(TimeDayOfYear(OrderOpenTime())==TimeDayOfYear(TimeCurrent()) &&
OrderSymbol()==_symbol && OrderMagicNumber()==newMagic && OrderComment()==_comment)
I think it might only work for the day .. but I would like to know if an order was placed on the current bar.
if(TimeDayOfYear(OrderOpenTime())==TimeDayOfYear(TimeCurrent()) &&
OrderSymbol()==_symbol && OrderMagicNumber()==newMagic && OrderComment()==_comment)
I think it might only work for the day .. but I would like to know if an order was placed on the current bar.
int bar_shift=iBarShift(Symbol(),0,OrderOpenTime());
if(bar_shift==0)
//Order was opened in the current bar
Keith Watford:
int bar_shift=iBarShift(Symbol(),0,OrderOpenTime());
if(bar_shift==0)
//Order was opened in the current bar
int bar_shift=iBarShift(Symbol(),0,OrderOpenTime());
if(bar_shift==0)
//Order was opened in the current bar
Or:
if(OrderOpenTime() >= Time[0])
honest_knave:
Now I feel foolish. That didn't even occur to me.
Or:
if(OrderOpenTime() >= Time[0])
excellent guys i like the iBarshift of OrderOpenTime() because what bar is the order from?
honest_knave:
Your solution is more flexible i.e. other symbols and timeframes, or checking other bars like the OP now wants.
i don't know how it even works ;) Your solution is more flexible i.e. other symbols and timeframes, or checking other bars like the OP now wants.
Time[0] always incrementing, OrderOpenTime() older than Time[0]
if(OrderOpenTime() >Time[1]){//its bar 0}
Brian Lillard:
i don't know how it even works ;)
Time[0] always incrementing, OrderOpenTime() older than Time[0]
i don't know how it even works ;)
Time[0] always incrementing, OrderOpenTime() older than Time[0]
Time[0] is the open time of the current bar, not the latest time.
Example:
Time now is 12:03:47 (hh:mm:ss)
Time[0] on an M1 chart is 12:03:00
Brian Lillard:
i don't know how it even works ;)
Time[0] always incrementing, OrderOpenTime() older than Time[0]
if OrderOpenTime() older than Time[0] then it cannot gave been opened in the current bar.
i don't know how it even works ;)
Time[0] always incrementing, OrderOpenTime() older than Time[0]
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
if i had to write it out it would be something like this,
get time of bar in seconds(current time)
get time of last bar in seconds and add the time in seconds to it we want and then compare it
if the comparison results in the current time being higher then the desired time then output nothing
if the comparison results in the current time being lower than the desired time than output something
therefore it could it also be possible to output something when the comparison is equal ??