StockFetcher Forums · General Discussion · Yabsi Indicator<< >>Post Follow-up
kibicricket
1 posts
msg #121343
Ignore kibicricket
8/16/2014 1:24:10 PM

Hey all, I found this board through several different websites. I came across the Yabsi indicator today which I thought was awesome upon first glance, but now realize is almost completely worthless since it prints its signal a few bars after the fact. Can anyone make a mod of the code below to include the same kind of mathematical analysis but have the indicator issue a signal immediately instead of having to wait several bars later?

Code Below -------------------------------------------------------

input signalOffsetFactor = 0.20;

def signalOffset = AvgTrueRange(high,close,low,9)*signalOffsetFactor; plot Data = hlc3;

def triggerSell = if(if(close[-1] < high, 1, 0) and (hlc3[-2] < close[-1] or hlc3[-3] < close[-1]), 1, 0);

def triggerBuy = if(if(close[-1] > low, 1, 0) and (hlc3[-2] > close[-1] or hlc3[-3] > close[-1]), 1, 0);

rec buySellSwitch = if(triggerSell, 1, if(triggerBuy, 0, buySellSwitch[1]));

def thirdBarClosed = if(IsNaN(hlc3[-3]), 0, 1);

plot SBS = if(triggerSell and thirdBarClosed and !buySellSwitch[1], high+signaloffset, if(triggerBuy and thirdBarClosed and buySellSwitch[1],low-signaloffset, double.nan));

SBS.SetStyle(curve.FIRM);
SBS.SetPaintingStrategy(paintingStrategy.LINE_VS_P OINTS);
SBS.SetLineWeight(2);

SBS.AssignValueColor(if triggerSell then
if thirdbarclosed then
#UpPos
CreateColor(255, 0, 0) else
#UpNeg
CreateColor(255, 0, 0)
else if Triggerbuy then
#DnPos
CreateColor(0, 255, 0) else
#DnNeg
CreateColor(0, 255, 0));



StockFetcher Forums · General Discussion · Yabsi Indicator<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.