公式网 股票指标公式源码分享 登录 注册
公式指标平网
未来函数检测
首页 金钻指标 通达信公式 大智慧公式 同花顺公式 文华财经公式 东财通公式 飞狐公式 操盘手公式 其他公式 公式解答 股票软件 股票池
当前位置:→ 公式网 > 通达信公式 > 正文 → 正文

通达信【股票之友S理论】——对比逻辑

发布时间:2014/3/4 8:21:06  浏览次数:

我本善良,沉默非弱!
最近,论坛有些友友对我很不满,严重质疑我的技术水平,我在本贴再次申明,我发贴是我兴趣,同时帮助喜欢我风格的友友们,早些建立自己的交易策略模型.
我绝对不会卖指标,也没有这必要! 有本事就明目张胆地挑战我,不要鬼鬼祟祟的!

以下是一个国外知名市场时机逻辑指标,有本事就编写出来,没本事就不要再打扰我,谢谢!

国外知名市场时机逻辑指标原本:
In “Timing The Market With Pairs Logic” in this issue, author Perry Kaufman explains how to backtest the idea of hedging with an index-based ETF. Based on his article, we have created two new strategies and a new study for thinkorswim users in our proprietary scripting language, thinkScript. One strategy is for the equity and the other strategy is for the ETF.
For the Equity Strategy click here or:

From our TOS Charts, Select Studies → Edit Studies.
Select the Strategy tab in the upper left hand corner.
Select New in the lower left hand corner.
Name the strategy (i.e. Stress)
Click in the script editor window, remove “addOrder(OrderType.BUY_AUTO, no);” and paste the following:
script StressIndicator {
input stock = "<currently selected symbol>";
input index = "SPY";
input length = 50;

def rangeStock = Highest(high(stock), length) - Lowest(low(stock), length);
plot StochStock = 100 * if rangeStock != 0 then (close(stock) - Lowest(low(stock), length)) / rangeStock else 0;

def rangeIndex = Highest(high(index), length) - Lowest(low(index), length);
plot StochIndex = 100 * if rangeIndex != 0 then (close(index) - Lowest(low(index), length)) / rangeIndex else 0;

def diff = StochStock - StochIndex;
def rangeDiff = Highest(diff, length) - Lowest(diff, length);
plot Stress = 100 * if rangeDiff != 0 then (diff - Lowest(diff, length)) / rangeDiff else 0;
}

input index = "SPY";
input length = 50;
input investment = 5000;
input entryLevel = 10;
input exitLevel = 50;
input stopLoss = 10.0;
input minPrice = 3.0;
input minPriceLength = 5;

def minPirceOk = Lowest(close, minPriceLength) > minPrice;
def stress = reference StressIndicator(index = index, length = length).Stress;
def entryPrice = EntryPrice();
def crisisStop = close / entryPrice - 1 < -stopLoss / 100;
def isReady = if !isReady[1] and stress > 50 then yes else if IsNaN(crisisStop) then isReady[1] else if !IsNaN(entryPrice) and crisisStop then no else isReady[1];

AddOrder(OrderType.BUY_TO_OPEN, isReady and stress <= entryLevel and minPirceOk, tradeSize = investment / close, tickColor = GetColor(1), arrowColor = GetColor(1), name = "StressLE");

AddOrder(OrderType.SELL_TO_CLOSE, !minPirceOk, tickColor = GetColor(2), arrowColor = GetColor(2), name = "StressMinPriceLX");
AddOrder(OrderType.SELL_TO_CLOSE, stress >= exitLevel, tickColor = GetColor(2), arrowColor = GetColor(2), name = "StressLX");
AddOrder(OrderType.SELL_TO_CLOSE, crisisStop, tickColor = GetColor(2), arrowColor = GetColor(2), name = "StressCrisisStopLX");

thinkorswim
A division of TD Ameritrade, Inc.

通达信【股票之友S理论】——对比逻辑

资源下载链接   资源大小:unknow

手机移动版 - 关于我们 - 联系我们 - 广告合作 - 下载声明 - 网站帮助 - 友情链接 - 网站地图 - TOP
湘ICP备09016573号-3 增值电信业务经营ICP许可证:湘B2-20210269 湘公网安备43108102000039号
Copyright © GSZX.COM.CN ,All Rights Reserved.
股票公式,股票指标,股票软件,股票知识