Forum

How to compare OrderOpenTime() and present time?

I want to set stoploss closer to open price when the position was opened for more than 120 min: So, I have this: for (int i = 0; i < OrdersTotal(); i++) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if ( OrderSymbol()==Symbol()) { if (OrderType() == OP_BUY) { if (present time - OrderOpenTime() >=

how to draw historical bar in current chart

Could anyone help? How to draw historical bars in current chart, e.g.: draw bars from two weeks ago on the present chart. Thanks

Help please, how to combine these two indicators?

I want to draw chart that will include weekends and public holidays, so we have this '"Free-of-Holes" Charts indicator' . Also, there is an indicator that can convert PERIOD "Period Converter Optimized ", Can we have an indicator that combine the two? For example, convert H1 to H8 and then to free

How to draw chart including weekends and public holidays

Hi, Do anyone know how to draw chart that will include weekends and public holidays, I mean the chart should contain continuous bars, without time gap. I know there is an indicator that can convert PERIOD, Can we have an indicator that will convert the regular chart without weekend bars to a chart

Help to calculate the slope of a line that is Perpendicular to a known line

I want to calculate the slope of a line that is Perpendicular to a known line: Line A is Perpendicular to line B; Slope of Line A: SlopeA = (Price1-Price2)/(bar2-bar1); Because Line A is vertical to line B, So: SlopeA*SlopeB = -1; Therefore: SlopeB = - 1/SlopeA = - (bar2-bar1)/(Price1-Price2);

Help to set time point

Please help to set time points: I want to set a time point that's sometime before a given time, for example: TodayDatetime=2009.07.09 0:00, to calculate a time point that's two weeks earlier: TwoWeeksDatetime=TodayDatetime - 2*7*24, time unit in hour, the problem is how to make this work? Thanks

Help for function call problem

I defined a function like this: int CalculateBars(int LastBar, int PastBars) { datetime _time = StrToTime(FixedDateTime), _time0 = StrToTime(FixedDateTime0); int LastBar = iBarShift(NULL, Period(), _time, false), PastBars= iBarShift(NULL, Period(), _time0, false); return(LastBar, PastBars); } When

how to get price value from Andrews pitchfork?

Could anyone help? how to get price value from Andrews pitchfork ? manually or indicator drawn? objectget will not work

Help for writing an expression

How to make EA add a new position when the first postition in profit: for example, the present long position is in profit of 25 pips, and I want the EA to add a new long position ( market order) based on this porfitable trade, how to code? Any help will be greatly appreciated. Thanks