Bruce, any hint on "it might be possible to do so using an external macro program of some sort, by automating a copy and paste of all symbols from an EasyScan" what software/how? All I need is the count of the Easyscan results.
|
Hello,
I am using the below in ThinkorSwim to plot the ATR Trailing Stop. Is there anyway I can convert this to StockFinder?
___________________________________
input trailType = {default modified, unmodified};
input ATRPeriod = 5;
input ATRFactor = 3.5;
input firstTrade = {default long, short};
assert(ATRFactor > 0, "'atr factor' must be positive: " + ATRFactor);
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1]
then high - close[1]
else (high - close[1]) - 0.5 * (low - high[1]);
def LRef = if high >= low[1]
then close[1] - low
else (close[1] - low) - 0.5 * (low[1] - high);
def ATRMod = ExpAverage(Max(HiLo, Max(HRef, LRef)), 2 * ATRPeriod - 1);
def loss;
switch (trailType) {
case modified:
loss = ATRFactor * ATRMod;
case unmodified:
loss = ATRFactor * AvgTrueRange(high, close, low, ATRPeriod);
}
rec state = {default init, long, short};
rec trail;
switch (state[1]) {
case init:
if (!IsNaN(loss)) {
switch (firstTrade) {
case long:
state = state.long;
trail = close - loss;
case short:
state = state.short;
trail = close + loss;
}
} else {
state = state.init;
trail = Double.NaN;
}
case long:
if (close > trail[1]) {
state = state.long;
trail = Max(trail[1], close - loss);
}
else {
state = state.short;
trail = close + loss;
}
case short:
if (close < trail[1]) {
state = state.short;
trail = Min(trail[1], close + loss);
}
else {
state = state.long;
trail = close - loss;
}
}
def BuySignal = Crosses(state == state.long, 0, CrossingDirection.Above);
def SellSignal = Crosses(state == state.short, 0, CrossingDirection.Above);
plot TrailingStop = trail;
TrailingStop.SetPaintingStrategy(PaintingStrategy.POINTS);
TrailingStop.DefineColor("Buy", GetColor(0));
TrailingStop.DefineColor("Sell", GetColor(1));
TrailingStop.AssignValueColor(if state == state.long
then TrailingStop.color("Sell")
else TrailingStop.color("Buy"));
____________________
Thanks,
Charles
|
Hello,
Can you please help me with the realcode for calculating the price% from a specific date until close of today? For example, I want a watchlist column showing the %price increase from low of 11/16/2012 to high of today.
Thanks
|
Hello,
Can you please help me with realcode for plotting two indicators for the active symbol showing the percentage displacement of the bar's price from its 52 week highs and lows. For example, today SPX is 15.58% from its 52 week low and 0.83% from its 52 week high. I would like to plot this so that I can get historical day for every bar in the chart.
Thanks. Appreciate it.
Charles
|
Thanks Bruce. But it appears the ATR Trailing Stop that I am looking for is not the same what we have here.
I was looking for something like what is documented at
http://team.thinkorswim.com/manual/dark/studies/studies%20library/A-B/ATRTrailingStop.html
I will play around a little more.
|
Hello,
Can you please help me out with the realcode (for Stockfinder) to calculate ATR Trailing Stop (2 x ATR stop that is calculated on 14 days)?
Thanks,
|
Hello,
Is there a way I can use 'Latest Float' and 'Price Growth Rate 1 Year' in a PCF?
Thanks
Charles
|