Updated: January 19th, 2019 (04:00 PM) Views / Replies: 415 / 3 Created: May 8th, 2018 (01:25 PM) by animeal Attachments: 0

 Welcome to futures io.

Singapore

Platform: Thinkorswim
Favorite Futures: Equity

Posts: 4 since Oct 2017

animeal

input nFE = 13;#hint nFE: length for Fractal Energy calculation.

input over_bought = 0.9;

# Variables:

def o;
def h;
def l;
def c;
def CU1;
def CU2;
def CU;
def CD1;
def CD2;
def CD;
def L0;
def L1;
def L2;
def L3;
plot RSI;
plot OS;
plot OB;

# Calculations
o = (open + close[1]) / 2;
h = Max(high, close[1]);
l = Min(low, close[1]);
c = (o + h + l + close) / 4;
plot gamma = Log(Sum((Max(high, close[1]) - Min(low, close[1])), nFE) /
(Highest(high, nFE) - Lowest(low, nFE)))
/ Log(nFE);
gamma.SetDefaultColor(Color.Yellow);
L0 = (1  gamma) * c + gamma * L0[1];
L1 = -gamma * L0 + L0[1] + gamma * L1[1];
L2 = -gamma * L1 + L1[1] + gamma * L2[1];
L3 = -gamma * L2 + L2[1] + gamma * L3[1];
if L0 >= L1
then {
CU1 = L0 - L1;
CD1 = 0;
} else {
CD1 = L1 - L0;
CU1 = 0;
}
if L1 >= L2
then {
CU2 = CU1 + L1 - L2;
CD2 = CD1;
} else {
CD2 = CD1 + L2 - L1;
CU2 = CU1;
}
if L2 >= L3
then {
CU = CU2 + L2 - L3;
CD = CD2;
} else {
CU = CU2;
CD = CD2 + L3 - L2;
}

RSI = if CU + CD <> 0 then CU / (CU + CD) else 0;
RSI.SetDefaultColor(Color.Cyan);
OS = if IsNaN(close) then Double.NaN else 0.2;
OS.SetDefaultColor(Color.Gray);
OS.HideBubble();
OS.HideTitle();
OB = if IsNaN(close) then Double.NaN else 0.8;
OB.SetDefaultColor(Color.Gray);
OB.HideBubble();
OB.HideTitle();
plot FEh = if isNaN(close) then double.nan else .618;
FEh.SetStyle(Curve.Long_Dash);
FEh.HideBubble();
FEh.SetDefaultColor(Color.Dark_Gray);
FEh.HideTitle();
plot FEl = if isNaN(close) then double.nan else .382;
FEl.SetStyle(Curve.Long_Dash);
FEl.SetDefaultColor(Color.Dark_Gray);
FEl.HideBubble();
FEl.HideTitle();

def signal = (Crosses(RSI, over_bought, CrossingDirection.BELOW));

 May 9th, 2018, 06:56 AM #3 (permalink) Trading Apprentice sacramento,ca   Trading Experience: Intermediate Platform: tos Favorite Futures: es ,gc   Posts: 3 since Apr 2018 Thanks: 0 given, 0 received thank you for reply. But how will this send text to an an sms? I would like to set it up a condition in Alerts tab but just not sure what to input. I've tried RSI > True and I also tried RSI > crosses under .9 but i get errors.

 January 19th, 2019, 04:00 PM #4 (permalink) Mark Paul Guest     Posts: n/a since Alert by SMS Hopefully this is already solved, but if not, Click Setup>Application Settings>Notifications and enter your SMS number. Once the alert is triggered in the code, the SMS will go out.

Upcoming Webinars and Events (4:30PM ET unless noted)

## futures io is celebrating 10-years w/ over \$18,000 in prizes!

Right now

 Similar Threads Thread Thread Starter Forum Replies Last Post Danyelle NinjaTrader 12 February 2nd, 2016 08:18 AM tdaman NinjaTrader 8 December 27th, 2015 02:31 PM Joseph689 NinjaTrader 4 December 8th, 2012 04:03 PM TradewithMoe NinjaTrader 4 August 8th, 2011 10:48 PM websouth The Elite Circle 3 November 7th, 2009 04:16 AM

 Tags alerts, code, coding, error, fractals, laguerre, rsi, signal, think or swim, thinkorswim, tos