- hello,how to get the high of the open position bar?
- Help to auto close order when new bar opens
- Help getting value
Thanks for the response GumRai. I have another question is there a way to change the value of the date to be comprehendible instead of (in this example) 1424690100 when using OrderOpenTime(). I was able to use the OrderOpenPrice() successfully but I am having issues with OrderOpenTime().
Thanks for the response GumRai. I have another question is there a way to change the value of the date to be comprehendible instead of (in this example) 1424690100 when using OrderOpenTime(). I was able to use the OrderOpenPrice() successfully but I am having issues with OrderOpenTime().
I believe that if you use #property strict all prints of a datetime variable will be readable as a date, not an integer.
Otherwise, use TimeToStr()
Ok , I was able to sort out the date issue , but now as seen on the attached images of my Journal and chart window, my iBarShift doesn’t correspond with my Date. Is there any solution for this?
{ bool exists = false; for (int i=OrdersTotal()-1; i >= 0; i--) if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if (OrderType() == OP_BUYSTOP && OrderSymbol() == Symbol() && OrderMagicNumber() == 1) { exists = true; } } else { Print("OrderSelect() error - ", ErrorDescription(GetLastError())); } if (exists) { Print("Index of the bar for the time ",TimeToStr(OrderOpenTime(),TIME_DATE|TIME_SECONDS)," is ",iBarShift(0,0,TimeToStr(OrderOpenTime(),TIME_DATE|TIME_SECONDS))); } }
You don't use a string in iBarShift
iBarShift(Symbol(),0,OrderOpenTime())
just use OrderOpenTime()

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use