i made my expert locked by certain account number and with time constraint and can only work on a demo account , the problem is that it doesn't perform any trades !
of course it does not performed any trade . There is no ordersend code has been implement .
of course it does not performed any trade . There is no ordersend code has been implement .
the whole logic and order sending and management are there , i just represented them with his line "logic for trades" as the problem isn't in there as i'm using the same expert just without the constraints and it's working fine
your code works for me.
1. Error is in the "logic for order"
2. the account number isn't right
1.Can't be . as i have mentioned i'm already using it without issues
2.i know , i changed it for the privacy of the client
1.Can't be . as i have mentioned i'm already using it without issues
2.i know , i changed it for the privacy of the client
void OnInit() { datetime now = TimeCurrent(); long account_login = AccountInfoInteger(ACCOUNT_LOGIN); if (account_login == allowed_accounts && now < allowed_until )
Don't try to use any price or server related functions in OnInit (or on load), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
"Can't be"doesn't work here. There is an issue somewhere.
yes live account ( DEMO NOT REAL)
Don't try to use any price or server related functions in OnInit (or on load), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
Thanks for the clarification , so you think if i moved the code in "OnInit" to "OnTick" , this would solve the issue ?
Thanks for the clarification , so you think if i moved the code in "OnInit" to "OnTick" , this would solve the issue ?
Why don't you simply debug your code instead of asking unanswerable questions. No one here knows about your broker and how they set up your account.
Print("account_login == allowed_accounts : ",account_login == allowed_accounts); Print("now < allowed_until : ",now < allowed_until); Print("password_status == 1 : ",password_status == 1); Print("TimeCurrent() < allowed_until : ",TimeCurrent() < allowed_until); Print("AccountInfoInteger(ACCOUNT_TRADE_MODE) == ACCOUNT_TRADE_MODE_DEMO : ",AccountInfoInteger(ACCOUNT_TRADE_MODE) == ACCOUNT_TRADE_MODE_DEMO);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i made my expert locked by certain account number and with time constraint and can only work on a demo account , the problem is that it doesn't perform any trades !