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
We want to run a script overnight and I have got the terminal.exe to run via a schedule to open the relevant chart and then run the script. This script collates the require variables, but cannot place the orders. It reports an Uninit 0 error. If I run the script manually, it works normally. And one of ten scheduled start has run the script and opened orders.
What am I missing here?
This is the settings files with user details amended:
; common settings
Profile=test 3
MarketWatch=set2.set
Login=9999999
Password=xxxxxx
Server=FXCM-GBPDemo01
AutoConfiguration=false
EnableDDE=true
EnableNews=false
Proxy Server Settings
; open chart and run expert and/or script
Symbol=USDJPY
Period=M30
Script=Dev/Gabi_Range_Trader_London_Session
This is a sample test script it tries to run:
void OnStart()
{
//---
//---Display Values of candles
//--- Candle Ranges 7 candles hourly
double Low_Range = Low[iLowest(NULL,PERIOD_M30,MODE_LOW,8,1)];
double High_Range = High[iHighest(NULL,PERIOD_M30,MODE_HIGH,8,1)];
Print ("Lowest value from previous 8 candles : ",Low_Range);
Print ("Highest value from previous 8 candles : ",High_Range);
double TakeProfitBuy = High_Range + ((High_Range - Low_Range)*1.5);
double TakeProfitSell = Low_Range - ((High_Range - Low_Range)*1.5);
//--- Place Buy Trade
int ticket_buy = OrderSend(Symbol(),OP_BUYSTOP,1,High_Range,3,Low_Range,TakeProfitBuy,"SAS-RANGE BOJ");
int ticket_buy2 = OrderSend(Symbol(),OP_BUYLIMIT,1,High_Range,3,Low_Range,TakeProfitBuy,"SAS-RANGE BOJ");
//--- Place Sell Trade
int ticket_sell = OrderSend(Symbol(),OP_SELLSTOP,1,Low_Range,3,High_Range,TakeProfitSell,"SAS-RANGE BOJ");
int ticket_sell2 = OrderSend(Symbol(),OP_SELLLIMIT,1,Low_Range,3,High_Range,TakeProfitSell,"SAS-RANGE BOJ");
}