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
I have never tried this, but I don't think it is valid . . .
I think you need to do this . . .
the reason why I think this is . . . what does this equate to ? (OP_BUYSTOP||OP_SELLSTOP) It might work if the variables were bool . . . but I don't think it can work with int.
One minor thing, you don't need the OderSelect before the OrderDelete. In general you only need OrderSelect when you use an Order function that doesn't use int ticket. e.g. OrderComment( ), OrderCommission( ), etc
Ok I repaired the logic. But it does not delete the orders still.
As I mentioned before I changed the counter from bars to time...
Ok thankyou Raptor, I just updated the code on my post. I just remembered how you guys mentioned it was no good to use bars for a counter so I changed it around to use bar time. Ill fix up the logic and see if it works.
is true, but you need to look at the context of when this comment was made . . . Bars is unreliable . . .
but that doesn't mean you can't use bar numbers instead of number of hours. For example how will your code cope on Friday evening and on into Sunday ? does pendinglimit equal 4 hours or 4 bars ?
Also what happens with this if a trade is placed at 22:00 ? 22 + 4 = 26 ?
Alright I see the problem there with the time strategy. But if we use bars as a counter once the chart reaches max bars it will fail there too, right?
I will get back to it and see what I can come up with...
Ok how about this approach
Alright I see the problem there with the time strategy. But if we use bars as a counter once the chart reaches max bars it will fail there too, right?
Nope, the current H1 bar is always bar 0 . . in 60 mins the current H1 bar will be bar 0 . . the bars issue is if you use Bars, meaning the total number of bars on your chart, or if you are looking at the bars to the far left of your chart.
The bar number for TimeHour(TimeCurrent() is 0, you can get the bar number for the time when your trade was placed (you need to calculate this not store it ! ! !) using iBarShift then do something like this . . .
OK 3rd time lucky, It took me a while to figure out what you were trying to say there. So here is what I have done. But the orders still don't get deleted >:(
tradeopened = TimeCurrent()
will not give me the bar opening time would I have to use Time[0]?Try this ;-)