This code is all over the place.
if(OrderSelect(tickets,SELECT_BY_POS,MODE_HISTORY==true)) //passing the result of a boolean expression as the pool param! } // what is this doing here??? datetime ctm=OrderCloseTime(); if(ctm!=0){ closed=true;
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) && OrderCloseTime() != 0) { ///Order is closed }
nicholi shen:
This code is all over the place.
Sorry, coorect code is as follows;
if(OrderSelect(tickets,SELECT_BY_POS,MODE_HISTORY==true)) { datetime ctm=OrderCloseTime(); if(ctm!=0){ closed=true;
Thank you for the code. However, OrderSelect is always says to me false. I don't understand.
I read that if I use Mode_History and select_by_pos, I cannot use tickets. I must use index.
However, what should the index be on back test? I am new one on programmer.
if(OrderSelect(tickets,SELECT_BY_POS,MODE_HISTORY==true)) { datetime ctm=OrderCloseTime(); if(ctm!=0){ closed=true;
Where do you get the value for the variable tickets from?
This type of code you would normally expect to see in a loop.
Your logic makes no sense. Why check if an order from the history pool is closed - All trades in the history pool must be closed or they wouldn't be in the pool.
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
Hi all,
I want to select my closed order on back test.
I use foolowing code;
However, Orderselect says always false.
What should I do?
Best.
Murat Y.