Since mid-October, prorealtime proorder has stopped working at IG Securities.
Below is one of the scripts that stopped working.
If anyone knows the cause,
I would appreciate it if you could tell me how to fix it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Parameters
deltaThreshold = 100 // Threshold for cumulative delta to determine trend
shortMA = 10 // Short Moving Average period
longMA = 50 // Long Moving Average period
rocPeriod = 14 // Period for Rate of Change (RoC)
// Variables
delta = 0
cumulativeDelta = 0
// Calculate Cumulative Delta
if close > open then
delta = volume
elsif close < open then
delta = - volume
else
delta = 0
endif
cumulativeDelta = cumulativeDelta + delta
// Calculate Moving Averages
shortMAValue = average [ shortMA] (close )
longMAValue = average [ longMA] (close )
// Calculate Rate of Change (RoC) for Volatility
rocValue = (close - close [ rocPeriod] ) / close [ rocPeriod]
// Trading Strategy with Volatility Filter
if cumulativeDelta > deltaThreshold and shortMAValue > longMAValue and abs (rocValue) > 0.02 then
buy 0.1 share at market
set stop loss 20
set target profit 40
elsif cumulativeDelta < - deltaThreshold and shortMAValue < longMAValue and abs (rocValue) > 0.02 then
sellshort 0.1 share at market
set stop loss 20
set target profit 40
endif