RickK
Active member
Here's a promising looking strategy that I found on thinkScript_Cloud. (I hope I'm allowed to post it here. ) It seems to be quite profitable with very manageable losses on small timeframes. Futures trading mostly, I think. There was no discussion where I found it, so I was hoping to get some going here. Apparently it has to do with Murrey Math / Donchian .... the former of which I know absolutely nothing about; the latter of which has not been kind to me in the past.
If you like it, can explain it, and/or find potential, please post back how you've used it. Specifically, with what other non-correlated confirming indicators have you used it, thoughts for improvements and possibly any rules you may come up with. I have not tested it in real-time yet, but I suspect that there might have some repainting as there is a higher time frame aggregation component.
BTW, apparently it has had the name "RSI_MultiAggregationStrat_DMonkey" in the past.
Oh, I made one small edit. I added an input for tradesize, since the original script limited it to 1 in the AddOrder command. After doing so, I tried it on $UPRO and $AAPL, modifying the tradesize input to 200...but it didn't really like that much.
If you like it, can explain it, and/or find potential, please post back how you've used it. Specifically, with what other non-correlated confirming indicators have you used it, thoughts for improvements and possibly any rules you may come up with. I have not tested it in real-time yet, but I suspect that there might have some repainting as there is a higher time frame aggregation component.
BTW, apparently it has had the name "RSI_MultiAggregationStrat_DMonkey" in the past.
Oh, I made one small edit. I added an input for tradesize, since the original script limited it to 1 in the AddOrder command. After doing so, I tried it on $UPRO and $AAPL, modifying the tradesize input to 200...but it didn't really like that much.
Code:
#StudyName: RTH // High // Low
#Description: Plots developing intraday high and low
#Author: DMonkey
#Requested By: ActiveTrader
# Ver 2 Up:Date 12/20/2017 : updated bubbles
# TOS.mx Link:
# Trading Notes:
# Added an input for tradesize, since the AddOrder had previously fixed it at 1. @Rick_Kennedy, member, usethinkscript.com
input bubbleson = yes;
input market_open = 0930;
input Duration_In_Hours = 6.5;
input Fraction = .3;
input range_picker =yes;
input Paint_Bars = yes;
input tradesize = 1;
def h = high;
def l = low;
def na = double.nan;
def Market_Duration = Duration_In_Hours * 60 * 60;
def Go_Time = secondsFromTime(market_open);
def openhigh = if Go_Time ==0
then h
else if h > openhigh[1]
then h
else openhigh[1];
plot data =
if Go_Time >= 0
&& go_Time < Market_Duration
then openhigh
else na
;
data.setpaintingStrategy(PaintingStrategy.DASHES);
data.setdefaultColor(Color.YELLOW);
data.setlineWeight(3);
def openlow = if Go_Time == 0
then l
else if l < openlow[1]
then l
else openlow[1];
plot data2 =
if Go_Time >= 0
&& go_Time < Market_Duration
then openlow
else na
;
data2.setpaintingStrategy(PaintingStrategy.DASHES);
data2.setdefaultColor(Color.MAGENTA);
data2.setlineWeight(3);
def RTH_High_bubble =
if Go_Time >= 0
then highestall(data)
else na;
def RTH_Low_bubble =
if Go_Time >= 0
then lowestall(data2)
else na;
AddChartBubble("time condition" = bubbleson == yes
&& if isnan(close[-1]) && !isnan(close)
then (RTH_High_bubble)
else na ,
"price location" = (RTH_High_bubble),
text = "RTH High : " + asdollars(round((RTH_High_bubble)/ ticksize(),0)* ticksize()),
color = Color.BLUE);
AddChartBubble("time condition" = bubbleson == yes
&& if isnan(close[-1]) && !isnan(close)
then RTH_Low_bubble
else na ,
"price location" = RTH_Low_bubble,
text = "RTH Low : " + asdollars(round((RTH_Low_bubble)/ ticksize(),0)* ticksize()),
color = Color.GRAY,
up = No);
# End Code
def range = Fraction *(data - data2);
plot se = data - range;
plot le = data2 + range;
def expansion_direction = if se > se[1] then 1 else if se < se[1] then 2 else expansion_direction[1];
addlabel(1,"Market is expanding " + if expansion_direction == 1 then "up." else if expansion_direction == 2 then "down." else "flat.",
if expansion_direction == 1 then color.green else if expansion_direction == 2 then color.red else color.orange);
input agg = aggregationPeriod.FOUR_MIN;
#input length = 100; # minval = 10
input mult1 = 0.125; # title = "Mutiplier; Only Supports 0.125 = 1/8");
input lines = 1; # true title= "Show Murrey Math Fractals");
input bc = 1; # (true, title = "Show Bar Colors Based On Oscillator");
# Donchanin Channel
def hi = data;
def lo = data2;
def range2 = hi - lo;
def multiplier = (range2) * mult1;
def midline = lo + multiplier * 4;
plot oscillator = ExpAverage((close(period = agg) - midline) / (if range_picker then range2 / 2 else range / 2), 1);
oscillator.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
def a = oscillator > 0 and oscillator < mult1 * 2;
def b = oscillator > 0 and oscillator < mult1 * 4;
def c = oscillator > 0 and oscillator < mult1 * 6;
def d = oscillator > 0 and oscillator < mult1 * 8;
def z = oscillator < 0 and oscillator > -mult1 * 2;
def y = oscillator < 0 and oscillator > -mult1 * 4;
def x = oscillator < 0 and oscillator > -mult1 * 6;
def w = oscillator < 0 and oscillator > -mult1 * 8;
oscillator.AssignValueColor( if a == 1
then Color.ORANGE
else if b == 1 then Color.ORANGE
else if c == 1 then Color.ORANGE
else if d == 1 then Color.GREEN
else if z == 1 then Color.ORANGE
else if y == 1 then Color.ORANGE
else if x == 1 then Color.ORANGE
else if w == 1 then Color.RED
else Color.BLUE);
plot L0 = 0;
L0.AssignValueColor(Color.CYAN);
plot PositiveQuadrant1 = if lines == 1 then mult1 * 2 else Double.NaN;
plot PositiveQuadrant2 = if lines == 1 then mult1 * 4 else Double.NaN;
plot PositiveQuadrant3 = if lines == 1 then mult1 * 6 else Double.NaN;
plot PositiveQuadrant4 = if lines == 1 then mult1 * 8 else Double.NaN;
plot NegativeQuadrant1 = if lines == 1 then -mult1 * 2 else Double.NaN;
plot NegativeQuadrant2 = if lines == 1 then -mult1 * 4 else Double.NaN;
plot NegativeQuadrant3 = if lines == 1 then -mult1 * 6 else Double.NaN;
plot NegativeQuadrant4 = if lines == 1 then -mult1 * 8 else Double.NaN;
PositiveQuadrant1.AssignValueColor(Color.LIGHT_GRAY);
PositiveQuadrant2.AssignValueColor(Color.LIGHT_GRAY);
PositiveQuadrant3.AssignValueColor(Color.LIGHT_GRAY);
PositiveQuadrant4.AssignValueColor(Color.LIGHT_GRAY);
NegativeQuadrant1.AssignValueColor(Color.LIGHT_GRAY);
NegativeQuadrant2.AssignValueColor(Color.LIGHT_GRAY);
NegativeQuadrant3.AssignValueColor(Color.LIGHT_GRAY);
NegativeQuadrant4.AssignValueColor(Color.LIGHT_GRAY);
assignPriceColor(if Paint_Bars
then if oscillator > 0 then color.green else color.red
else color.current);
input offset = -1;
def buy_condition = oscillator crosses above 0 or oscillator crosses above w or oscillator crosses above d;
def sell_condition = oscillator crosses below 0 or oscillator crosses below d or oscillator crosses below w;
input trade_time_Start = 0906;
input trade_time_end = 1410;
input Use_RTH = yes;
def active2 = if SecondsFromTime(trade_time_Start) >= 0 && SecondsTillTime(trade_time_end) >= 0 then 1 else 0;
def buy_at_open = oscillator > 0;
def sell_at_open =oscillator < 0;
AddOrder(OrderType.BUY_TO_OPEN, if SecondsFromTime(trade_time_Start) == 0 then buy_at_open else Double.NaN, open(priceType = PriceType.ASK)[-1], tradeSize, name = "Buy To Open : $" + open(priceType = PriceType.ASK)[-1] , tickColor = Color.GREEN, arrowColor = Color.ORANGE);
AddOrder(OrderType.SELL_TO_OPEN, if SecondsFromTime(trade_time_Start) == 0 then sell_at_open else Double.NaN, open(priceType = PriceType.BID)[0], tradeSize, name = "Sell To Open : $" + open(priceType = PriceType.BID)[-1], tickColor = Color.RED, arrowColor = Color.ORANGE);
def EOD = SecondsFromTime(trade_time_end) == 0;
AddOrder(type = OrderType.SELL_TO_CLOSE, condition = if Use_RTH && active2 then EOD else Double.NaN, price = close(priceType = PriceType.BID), tradeSize, name = "Sell To Close : $" + close(priceType = PriceType.BID), tickColor = Color.RED, arrowColor = Color.ORANGE);
AddOrder(type = OrderType.BUY_TO_CLOSE, condition = if Use_RTH && active2 then EOD else Double.NaN, price = close(priceType = PriceType.ASK), tradeSize, name = "Buy To Close : $" + close(priceType = PriceType.ASK), tickColor = Color.GREEN, arrowColor = Color.ORANGE);
AddOrder(OrderType.BUY_AUTO, if Use_RTH
then active2 && buy_condition
else buy_condition,
tradeSize = 1,
price = open(priceType = PriceType.ASK)[offset],
name = "Buy : $" + open(priceType = PriceType.ASK)[offset],
tickColor = Color.GREEN,
arrowColor = Color.ORANGE);
AddOrder(type = OrderType.SELL_AUTO, condition = if Use_RTH
then active2 && sell_condition
else sell_condition,
tradeSize = 1,
price = open(priceType = PriceType.BID)[offset],
name = "Sell : $" + open(priceType = PriceType.BID)[offset],
tickColor = Color.RED,
arrowColor = Color.ORANGE);
### end of code
Last edited: