Mimicking "Power X Strategy" by Markus Heitkoetter

Hi Everyone...Came upon an interesting read by a guy called Markus Heikoetter who is the author of the Power X Strategy. Looking to see if someone can help code something like this Power X Strategy for ThinkorSwim with the 3 lower studies color coded. Thanks!!

Here is a copy of that Power X Strategy PDF which shows all 3 lower studies combined and color coded: https://rockwell-files.s3.amazonaws.com/PXCompanionGuide2ndEd_cover.pdf

(If you scroll down and look thru pages 11 thru 25 you'll see what I mean...)

Examples:


 
Last edited:

BenTen's Watchlist + Setup + Trade Recaps

Get access to Ben's watchlist, swing trading strategy, ThinkorSwim setup, and trade examples.

Learn more

cos251

Active member
Hi @Joseph Patrick 18 Please see the shared grid below. I will apologize up front, I made a few assumptions based on the shading. The shading is based on all 3 conditions being met rather than trying to line then up manually. I also combined the RSI and Stochastic since they are on the same range plot to save space. Hopefully this is along the lines of what you are looking for. Personally I think the shading required of all 3 conditions being met is better since it helps further confirm your trend a bit more definitively. At least that is my first reaction, could be wrong. Take a peak and see what you think. This is my first real attempt at a request from another member please provide constructive criticism/feedback. Thanks.

Edit* - I used this from your post above
#REQUIREMENTS - RSI Set to 7, EXPONENTIAL
# Stoch Slow 5(not14) and 3 WILDERS
# MACD 12,26,9 WEIGHTED

https://tos.mx/DJMLB1n

 

RickAns

Active member
VIP
Nice bit of coding, cos251. Thanks.

Here is my crude attempt at a label for the Target / Loss as mentioned in the .pdf

Code:
# Average Daily Range
def ADR = Average(High(period = AggregationPeriod.DAY) - Low(period = AggregationPeriod.DAY), 7);

AddLabel(yes, "Profit Target = +" +ADR * 3+ "", color.GREEN);
AddLabel(yes, " : Stop Loss =  -" +ADR * 1.5+ "", color.PINK);
AddLabel(yes, " : ADR daily = " +ADR+ "", color.GRAY);

plot ADRa = ADR; # uncheckmark the box in settings to hide this.

updated 11-29-20 below to show price as well. This is a label for the points of the current day.

def ADR = Average(High(period = AggregationPeriod.DAY) - Low(period = AggregationPeriod.DAY), 7);

AddLabel(yes, "Profit_X Target = +" +ADR * 3+ "", color.GREEN);
AddLabel(yes, "(" +(close(period = AggregationPeriod.DAY) + (ADR * 3))+ ")", color.GREEN);
AddLabel(yes, " : Stop_X Loss = -" +ADR * 1.5+ "", color.Pink);
AddLabel(yes, "(" +(close(period = AggregationPeriod.DAY) - (ADR * 1.5))+ ")", color.Pink);
#AddLabel(yes, " : ADR_X daily = " +ADR+ "", color.GRAY);


#plot ADRa = ADR; # uncheckmark in settings to hide
 
Last edited:
@generic Hi, actually I don't know...it is just the generic TOS RSI study and I removed the 80 and 100 lines and then threw in a manual 50 line with help from a script from Ben10....

@cos251 Wow!! Thanks Cos that looks perfect! And the fact that you combined both the RSI and Stoch is perfect for the setup with my charts! Also thanks for having the upper sync with the lower studies!! That helps me out big time. Thanks so much for taking the time to help me out and I will let you know how I make out! Thank you so much.

@RickAns Thanks Rick appreciate your help with the labeling. I will give it a whirl. Thanks for taking the time out!
 
Last edited by a moderator:

cos251

Active member
Hi @Joseph Patrick 18 - thanks so much for the feedback. I'll try and review the pics a bit today and see if we can't make some tweaks to sync it up a bit better. I may even try and split the Stochastic/RSI just so we know we have everything configured properly. I'll get back to you on it.
 

RickAns

Active member
VIP
@cos251 , is there a way to adjust the gray of the candles? I would like them to stand out a little more against my dark background. Skimmed through your code and don't see an option. Maybe I have overlooked it. Really like what you have done with this.
 
@cos251 , is there a way to adjust the gray of the candles? I would like them to stand out a little more against my dark background. Skimmed through your code and don't see an option. Maybe I have overlooked it. Really like what you have done with this.
Here you go just change this LINE 144 2nd line change Color.Dark_Grey to Color.WHITE ...or any color that you want.

 

cos251

Active member
Hi @Joseph Patrick 18 - I have taken a quick peek at the indicators vs your screenshots and to me it looks like the calculations are matching up, at least a quick glance. Please feel free to correct me here, I may have missed something. However, I think I know what the may be causing the skew. When I coded the shaded area I set it to POSITIVE_INFINITY and NEGATIVE_INFINITY. The reason for this was so that the area of the lower indicator could be shaded from top to bottom no matter the vertical expansion. I modified it to just shade 100 to 0 area and if you expand the lower indicator area the areas above 100 and below 0 are not shaded. See below for the alternate code and quick screen shot of the modification.

Code:
#AddCloud(if rsiGreen and stochGreen and macdGreen then Double.POSITIVE_INFINITY else Double.NaN, if rsiGreen and #stochGreen then Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_Green);
#AddCloud(if rsiRed and stochRed and macdRed then Double.POSITIVE_INFINITY else Double.NaN, if rsiRed and stochRed then #Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_RED);
AddCloud(if rsiGreen and stochGreen and macdGreen then 100 else Double.NaN, if rsiGreen and stochGreen then 0 else Double.NaN, Color.LIGHT_Green);
AddCloud(if rsiRed and stochRed and macdRed then 100 else Double.NaN, if rsiRed and stochRed then 0 else Double.NaN, Color.LIGHT_RED);

Take a peek and let me know if you concur. Otherwise we can keep digging. The top indicator (w/ shaded area) has the modified shaded area code to only shade 100 to 0. The lower one shades everything from top to bottom no mater the vertical shrink or expansion of the range plot. I hope this makes sense.

 

Similar threads

Top