Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
in that loop you can check all related whit the order... function
try search the word "order" in the "search" tab of the "Navigation" window
you will find all function about order
to compair with the bar time use Time[0] or iTime(..) function
like if(orderclosetime()>Time[0]) blockopen=true;
Ok it worked, but now the problem is performance. Checking the whole history takes time. I did a backtest for a year and a half period and I noticed that it is slow. The reason is that I am checking all orders in history and compare thier close price and close time. So, is there anyway to limit the history search to make it search only the recent orders? Can I increase the performance anyhow?
Are there exist possibilities to create piece of code which can disable opreation of Expert Advisor on the definite week's day, for example: Monday, Tuesday...etc.?
I'm not a programmer and that's why I ask for Your advice & help
Best regards,
Warren
__________________
Short Term Pain for Long Term Gain!
Comment( "\n"," * SOLAR WIND EXPERT ADVISOR *", "\n", "\n", " - PROGRAM IN SLEEP CYCLE - ", "\n", "\n"," > NON-TRADING HOURS! <");
return(0); } }
Adapt this code using below:
PHP Code:
int DayOfWeek( ) Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time. Note: At the testing, the last known server time is modelled. Sample: // does not work on holidays. if(DayOfWeek()==0 || DayOfWeek()==6) return(0);
extern bool UseHourTrade=false; Change statements to: UseDayOfWeek=false;
extern bool Monday=true;
extern bool Tuesday=true;
extern bool Wednesday=true;
extern bool Thursday=True;
extern bool Friday=True;
Good Luck! P.S. || is the same as (or). Try substituting Hour() with: if(!(DayOfWeek()=2 && Tuesday=true)) a=1;
I am not an expert at coding, but this should get you in the ballpark!
Ok it worked, but now the problem is performance. Checking the whole history takes time. I did a backtest for a year and a half period and I noticed that it is slow. The reason is that I am checking all orders in history and compare thier close price and close time. So, is there anyway to limit the history search to make it search only the recent orders? Can I increase the performance anyhow?
you may try OrderSelect(HistoryTotal(),SELECT_BY_POS,MODE_HIST ORY);
but i'm not sure for this one , i think it will pick up the last order in whole history