Login Page - Create Account

Support Board


Date/Time: Sun, 29 Dec 2024 10:30:18 +0000



Post From: sc.NumberOfTrades /Message.Format() - strange behavior

[2016-01-18 14:55:22]
User754985 - Posts: 109
I am using IB's True RT 5-sec bars which get delivered in SC as 4 trades (1=O, 2=H..) every 5-sec. So, a 1-min bar contains 48 trades (can be seen on a chart).

Now, the following code


SCSubgraphRef NT = sc.Subgraph[3];
if (sc.Defaults){
.....
sc.Autoloop=1
sc.UpdateAlways=0
}

if (sc.NumberOfTrades[i]==48)
{
  Message.Format("Number of Trades: %i", sc.NumberOfTrades[i]);
  sc.AddMessageToLog(Message,0);
        
  NT[i] = sc.NumberOfTrades[i];  
........
}

..produces this output:

Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:00
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:00
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:00
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:00
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:01
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:01
Chart: EUR.JPY-CASH-IDEALPRO 1 Min #1 | Study: FADM Example | Number of Trades: 0 | 2016-01-18 09:53:01

1) Why would Message.Format() give a value of 0?

When applying a study to a chart, I can see it graphing and adding messages to the log only starting from the most recent bar, nothing for historical.
2) Why would it not show anything for historical bars? not even 0..

3) Does sc.AddMessageToLog only work for RT or replay bars?

Thanks.
Date Time Of Last Edit: 2016-01-18 15:03:13