I think it has been asked earlier in this forum but did not get a very feasible solution. Here is the script for Std. Dev for VWAP in TOS. How can this be converted to SF5?
input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};
def cap = getAggregationPeriod();
def errorInAggregation =
timeFrame == timeFrame.DAY and cap >= AggregationPeriod.WEEK or
timeFrame == timeFrame.WEEK and cap >= AggregationPeriod.MONTH;
assert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period");
def yyyyMmDd = getYyyyMmDd();
def periodIndx;
switch (timeFrame) {
case DAY:
periodIndx = yyyyMmDd;
case WEEK:
periodIndx = Floor((daysFromDate(first(yyyyMmDd)) + getDayOfWeek(first(yyyyMmDd))) / 7);
case MONTH:
periodIndx = roundDown(yyyyMmDd / 100, 0);
}
def isPeriodRolled = compoundValue(1, periodIndx != periodIndx[1], yes);
def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;
if (isPeriodRolled) {
volumeSum = volume;
volumeVwapSum = volume * vwap;
volumeVwap2Sum = volume * Sqr(vwap);
} else {
volumeSum = compoundValue(1, volumeSum[1] + volume, volume);
volumeVwapSum = compoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
volumeVwap2Sum = compoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price = volumeVwapSum / volumeSum;
def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum - Sqr(price), 0));
plot VWAP = price;
plot UpperBand = price + numDevUp * deviation;
plot LowerBand = price + numDevDn * deviation;
VWAP.setDefaultColor(getColor(0));
UpperBand.setDefaultColor(getColor(2));
LowerBand.setDefaultColor(getColor(4));
|
Hi Bruce
I tried the method you described several ways but no luck. For instance I am trying to export hourly prices of NYSE or DJ-30. After I set the "Length Limit" in the block diagram - I can see the bars from Jun 2009. But when I export the data with the MA1 (with offset of 4999) - I only get the data from 2012 onwards.
Please help.
Thanks
|
The most important T2s I am interested in are T2108, T2107, T2104
|
TC2000 has started tracking the T2s intraday since May 2013; but I am trying to calculate this data on intraday basis before 2013.
The formula for T2108 and the indicator "% of Stocks Above/Below Exponential MA" do not seem to match. I have way different values than what T2108 is providing. I suspect the reason is that T2108 is looking a daily price moving average and the formula in the SF5 indicator is looking at the intraday time frame moving average.
Could you please help in coming up with the right formula or providing historical intraday data using internal calculations on your side?
Thanks
|
hi bruce
could you please give me more details about how to create the duplicate indicator. say i have a macd of a T2 indicator I want to export. how to force the export window to export more than 5000 of this?
some example will really help a lot.
thanks in advance
|
I am able to draw more than 5000 bars by customizing the blocks and adding the input length parameter. But how can I export more than 5000 bar data?
In case SF5 cannot export more than 5000 bars - Is it possible to read the SF5 data files directly via some script or program?
Thanks
|
ok thanks - can we expect this to be rectified in an upcoming version?
|
thanks i found it. but i ran into another issue now.
i am trying to apply this cumulative indicator to a MACD value. but when i change the datasource of the cumulative indicator and assign it an macd - it does not draw any graph lines. the pane is just empty.
|
thanks a lot - how do i access this cumulative indicator? when i click on new - i get 2 options - for PCF condition PCF or indicator PCF. In the indicator PCF - I do not get any option for cumulative
|
is there a way I can plot a cumulative value of any other indicator? I am using TC2000 12.4.
TIA.
|