Thanks GraHal.
Very disappointing to see the Bid/Ask Line Indicator on the chart and then not being able to grab it and use the values to implement live dynamic spread calculation in automated strategies.
PRT clearly has the values, but I can’t find a way to reach them programmatically.
Very annoying.
If anyone can do this on PRT, I’d like to hear from them. Will have a look on the French side as well.
I think PRT could help you.
That really is too bad! I too would love to be able to “call” spread for calculations…
I guess one option would be to trade “raw spreads”? Just a thought, but seems too simple to be viable. I’ve never had a raw-spread account, but if your broker offered one, would that not be more consistent for the calculations? Spread being negated?
Did my workaround on these to get spread pricings in indicator.
// https://www.ig.com/en/help-and-support/cfds/fees-and-charges/what-are-igs-indices-cfd-product-details
// CET times (Paris, Berlin, Amsterdam)
timeDAX1 = time >= 000000 and time < 011500 //Germany 40: 22.00-01.15 (CET) spread = 5
timeDAX2 = time >= 011500 and time < 080000 //Germany 40: 01.15-08.00 (CET) spread = 4
timeDAX3 = time >= 080000 and time < 090000 //Germany 40: 08.00-09.00 (CET) spread = 2
timeDAX4 = time >= 090000 and time < 173000 //Germany 40: 09.00-17.30 (CET) spread = 1.2
timeDAX5 = time >= 173000 and time < 220000 //Germany 40: 17.30-22.00 (CET) spread = 2
timeDAX6 = time >= 220000 and time < 000000 //Germany 40: 22.00-01.15 (CET) spread = 5
timeSTXE1 = time >= 000000 and time < 011500 //EU Stocks 50: 22.00-01.15 (CET) spread = 3
timeSTXE2 = time >= 011500 and time < 080000 //EU Stocks 50: 01.15-08.00 (CET) spread = 1,5
timeSTXE3 = time >= 080000 and time < 220000 //EU Stocks 50: 08.00-22.00 (CET) spread = 1,5
timeSTXE4 = time >= 220000 and time < 000000 //EU Stocks 50: 22.00-01.15 (CET) spread = 3
timePXI1 = time >= 000000 and time < 011500 //France 40: 22.00-01.15 (CET) spread = 4
timePXI2 = time >= 011500 and time < 080000 //France 40: 01.15-08.00 (CET) spread = 3
timePXI3 = time >= 080000 and time < 090000 //France 40: 08.00-09.00 (CET) spread = 2
timePXI4 = time >= 090000 and time < 173000 //France 40: 09.00-17.30 (CET) spread = 1
timePXI5 = time >= 173000 and time < 220000 //France 40: 17.30-22.00 (CET) spread = 2
timePXI6 = time >= 220000 and time < 000000 //France 40: 22.00-01.15 (CET) spread = 4
timeUKX1 = time >= 000000 and time < 060000 //FTSE 100: 01.00-07.00 (GMT) spread = 3
timeUKX2 = time >= 060000 and time < 070000 //FTSE 100: 07.00-08.00 (GMT) spread = 2
timeUKX3 = time >= 070000 and time < 153000 //FTSE 100: 08.00-16.30 (GMT) spread = 1
timeUKX4 = time >= 153000 and time < 200000 //FTSE 100: 16.30-21.00 (GMT) spread = 2
timeUKX5 = time >= 200000 and time < 000000 //FTSE 100: 21.00-01.00 (GMT) spread = 4
timeNASDAQ1 = time >= 000000 and time < 153000 //US Tech 100: All other times (EST) spread = 2
timeNASDAQ2 = time >= 153000 and time < 220000 //US Tech 100: 09.30-16.00 (EST) spread = 1
timeNASDAQ3 = time >= 220000 and time < 230000 //US Tech 100: All other times (EST) spread = 2
timeNASDAQ4 = time >= 230000 and time < 000000 //US Tech 100: 17.00-18.00 (EST) spread = 3
timeSPTRD1 = time >= 000000 and time < 153000 //US 500: All other times (EST) spread = 0.6
timeSPTRD2 = time >= 153000 and time < 220000 //US 500: 09.30-16.00 (EST) spread = 0.4
timeSPTRD3 = time >= 220000 and time < 230000 //US 500: All other times (EST) spread = 0.6
timeSPTRD4 = time >= 230000 and time < 000000 //US 500: 17.00-18.00 (EST) spread = 0.9
timeDOW1 = time >= 000000 and time < 090000 //Wall Street: All other times (EST) spread = 4.8
timeDOW2 = time >= 090000 and time < 153000 //Wall Street: 03.00-09.30 (EST) spread = 3.6
timeDOW3 = time >= 153000 and time < 220000 //Wall Street: 09.30-16.00 (EST) spread = 2.4
timeDOW4 = time >= 220000 and time < 230000 //Wall Street: All other times (EST) spread = 4.8
timeDOW5 = time >= 230000 and time < 000000 //Wall Street: 17.00-18.00 (EST) spread = 9.8
if timeDAX1 then
spreadDAX = 5
elsif timeDAX2 then
spreadDAX = 4
elsif timeDAX3 then
spreadDAX = 2
elsif timeDAX4 then
spreadDAX = 1.2
elsif timeDAX5 then
spreadDAX = 2
elsif timeDAX6 then
spreadDAX = 5
endif
if timeSTXE1 then
spreadSTXE = 23
elsif timeSTXE2 then
spreadSTXE = 1.5
elsif timeSTXE3 then
spreadSTXE = 1.5
elsif timeSTXE4 then
spreadSTXE = 3
endif
if timePXI1 then
spreadPXI = 4
elsif timePXI2 then
spreadPXI = 3
elsif timePXI3 then
spreadPXI = 2
elsif timePXI4 then
spreadPXI = 1
elsif timePXI5 then
spreadPXI = 2
elsif timePXI6 then
spreadPXI = 4
endif
if timeUKX1 then
spreadUKX = 3
elsif timeUKX2 then
spreadUKX = 2
elsif timeUKX3 then
spreadUKX = 1
elsif timeUKX4 then
spreadUKX = 2
elsif timeUKX5 then
spreadUKX = 4
endif
if timeNASDAQ1 then
spreadNASDAQ = 2
elsif timeNASDAQ2 then
spreadNASDAQ = 1
elsif timeNASDAQ3 then
spreadNASDAQ = 2
elsif timeNASDAQ4 then
spreadNASDAQ = 3
endif
if timeSPTRD1 then
spreadSPTRD = 0.6
elsif timeSPTRD2 then
spreadSPTRD = 0.4
elsif timeSPTRD3 then
spreadSPTRD = 0.6
elsif timeSPTRD4 then
spreadSPTRD = 0.9
endif
if timeDOW1 then
spreadDOW = 4.8
elsif timeDOW2 then
spreadDOW = 3.6
elsif timeDOW3 then
spreadDOW = 2.4
elsif timeDOW4 then
spreadDOW = 4.8
elsif timeDOW5 then
spreadDOW = 9.8
ENDIF
return spreadDAX as "DAX", spreadSTXE as "STXE", spreadPXI as "PXI", spreadUKX as "UKX", spreadNASDAQ as "NASDAQ", spreadSPTRD as "SPTRD-SP500", spreadDOW as "DOW"