Thinkscript to EasyLanguage - futures io
futures io



Thinkscript to EasyLanguage


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one StockT8er with 13 posts (0 thanks)
    2. looks_two mntman with 7 posts (4 thanks)
    3. looks_3 markmanu with 4 posts (1 thanks)
    4. looks_4 kjhosken with 3 posts (0 thanks)
    1. trending_up 6,402 views
    2. thumb_up 6 thanks given
    3. group 11 followers
    1. forum 33 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Thinkscript to EasyLanguage

(login for full post details)
  #1 (permalink)
markmanu
Kansas
 
 
Posts: 6 since Dec 2018
Thanks: 0 given, 1 received

I'm a trainer and it's a bit complicated for me to convert this thinkscript code to easy language.
Can anyone please help me? Many thanks



declare upper;

input avglength = 14;
input MTaverageType = AverageType.WILDERS;
input ATRLength = 5;
input MTprice = hlc3;
input MTreversalMode = {default ATRpercent, price};
input MTreversalAmount = .5;

##DayATR Value Calculation
def highPrice = FundamentalType.high;
def closePrice = FundamentalType.close;
def lowPrice = FundamentalType.low;
def aggregationPeriod = AggregationPeriod.DAY;
rec AvgTrueRange = MovingAverage(AverageType.SIMPLE, TrueRange(Fundamental (highPrice, period = AggregationPeriod.Day), Fundamental (closePrice, period = AggregationPeriod.DAY), Fundamental (lowPrice, period = AggregationPeriod.DAY) ),ATRlength);

##############
##ATR percent conversion calculation
rec DayATRReversalValue = MTreversalAmount*(AvgTrueRange/close)*100;

def mode = if MTreversalMode == MTreversalMode.price then ZigZagTrendSign(price = MTprice, reversalAmount=MTreversalAmount) else ZigZagTrendPercent(price = MTprice, reversalAmount=DayATRReversalValue);
def MTinflection = if MTreversalMode == MTreversalMode.price then if !isNan(ZigZagSign(price = MTprice, reversalAmount=MTreversalAmount)) then 1 else 0 else if !isNan(ZigZagPercent(price = MTprice, reversalAmount=DayATRReversalValue)) then 1 else 0;
rec MTtrend = if MTinflection==1 and mode ==-1 then 1 else if MTinflection==1 and mode==1 then -1 else MTtrend[1];

rec MTupWaveVolume = if MTinflection==1 and MTtrend==1 and close>open then volume else if MTinflection==1 and MTtrend==1 and close <= open then 0 else if MTtrend==1 or (MTinflection==1 and MTtrend ==-1 and close>=open) then MTupWaveVolume[1]+volume else 0;
rec MTdownWaveVolume = if MTinflection==1 and MTtrend ==-1 and close<open then volume else if MTinflection==1 and MTtrend ==-1 and close>=open then 0 else if MTtrend==-1 or (MTinflection==1 and MTtrend==1 and close <= open) then MTdownWaveVolume[1]+volume else 0;



plot BuySignal = MTinflection[1] and MTdownwavevolume[2] > 0;
BuySignal.SetDefaultColor(Color.Cyan);
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.SetLineWeight(4);

plot SellSignal = MTinflection[1] and MTupwavevolume[2] > 0;
SellSignal.SetDefaultColor(Color.Magenta);
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SellSignal.SetLineWeight(4);

####################
##volume label add-on

##input MTVolumeAudible_Alert = yes;
def MTVolumeDeviation_Length = 60;
def MTVolumeDeviate = 2;
def MTvolumestdevlength = RelativeVolumeStDev(length = MTvolumeDeviation_Length);
def abovedev = MTvolumestdevlength >= MTvolumeDeviate;
def belowdev = MTvolumestdevlength <= MTvolumeDeviate;


def MTvolumeincrease = volume > volume[1];
def MTvolumedevincrease = MTvolumeincrease and abovedev;
def MTvolumedecrease = volume < volume[1];
def MTvolumedevdecrease = MTvolumedecrease and abovedev;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def MTvolumeBuying = V * (C - L) / (H - L);
def MTvolumeSelling = V * (H - C) / (H - L);


input Show_Labels = yes;
AddLabel(Show_Labels, "Buy Vol = " + Round(MTvolumeBuying, 0), if MTvolumeBuying > MTvolumeSelling then color.green else color.red);
AddLabel(Show_Labels, "Sell Vol = " + Round(MTvolumeSelling, 0), if MTvolumeSelling > MTvolumeBuying then color.green else color.red);

Reply With Quote
The following user says Thank You to markmanu for this post:

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(266 thanks from 25 posts)
looks_twoSalao's Journalby Salao
(61 thanks from 12 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(48 thanks from 18 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(37 thanks from 15 posts)
looks_5Maybe a little bit different journalby Malykubo
(17 thanks from 16 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
86 thanks
Big Mike in Ecuador
76 thanks
Help improve the FIO community
41 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
30 thanks
futures io site changelog and issues/problem reporting
21 thanks
 
(login for full post details)
  #2 (permalink)
 Massive l 
Legendary Market Wizard
Portland, OR
 
Experience: None
 
Massive l's Avatar
 
Posts: 2,012 since Mar 2011
Thanks: 1,698 given, 4,191 received

I don't use easy language but this looks like a really neat script. Do you currently use it in your trading plan?

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #3 (permalink)
markmanu
Kansas
 
 
Posts: 6 since Dec 2018
Thanks: 0 given, 1 received



Massive l View Post
I don't use easy language but this looks like a really neat script. Do you currently use it in your trading plan?

Thanks for your reply.
This is studies from thinkorswim. And I want to convert these indicators for using on tradestation.
Do you have any ideas to convert it?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
markmanu
Kansas
 
 
Posts: 6 since Dec 2018
Thanks: 0 given, 1 received

Is there anyone who can help me to convert this code?
Please do not hesitate to give me any opinion you have, thanks

Reply With Quote
 
(login for full post details)
  #5 (permalink)
fxprogrammer
Phuket
 
 
Posts: 1 since Dec 2018
Thanks: 0 given, 0 received


markmanu View Post
I'm a trainer and it's a bit complicated for me to convert this thinkscript code to easy language.
Can anyone please help me? Many thanks



declare upper;

input avglength = 14;
input MTaverageType = AverageType.WILDERS;
input ATRLength = 5;
input MTprice = hlc3;
input MTreversalMode = {default ATRpercent, price};
input MTreversalAmount = .5;

##DayATR Value Calculation
def highPrice = FundamentalType.high;
def closePrice = FundamentalType.close;
def lowPrice = FundamentalType.low;
def aggregationPeriod = AggregationPeriod.DAY;
rec AvgTrueRange = MovingAverage(AverageType.SIMPLE, TrueRange(Fundamental (highPrice, period = AggregationPeriod.Day), Fundamental (closePrice, period = AggregationPeriod.DAY), Fundamental (lowPrice, period = AggregationPeriod.DAY) ),ATRlength);

##############
##ATR percent conversion calculation
rec DayATRReversalValue = MTreversalAmount*(AvgTrueRange/close)*100;

def mode = if MTreversalMode == MTreversalMode.price then ZigZagTrendSign(price = MTprice, reversalAmount=MTreversalAmount) else ZigZagTrendPercent(price = MTprice, reversalAmount=DayATRReversalValue);
def MTinflection = if MTreversalMode == MTreversalMode.price then if !isNan(ZigZagSign(price = MTprice, reversalAmount=MTreversalAmount)) then 1 else 0 else if !isNan(ZigZagPercent(price = MTprice, reversalAmount=DayATRReversalValue)) then 1 else 0;
rec MTtrend = if MTinflection==1 and mode ==-1 then 1 else if MTinflection==1 and mode==1 then -1 else MTtrend[1];

rec MTupWaveVolume = if MTinflection==1 and MTtrend==1 and close>open then volume else if MTinflection==1 and MTtrend==1 and close <= open then 0 else if MTtrend==1 or (MTinflection==1 and MTtrend ==-1 and close>=open) then MTupWaveVolume[1]+volume else 0;
rec MTdownWaveVolume = if MTinflection==1 and MTtrend ==-1 and close<open then volume else if MTinflection==1 and MTtrend ==-1 and close>=open then 0 else if MTtrend==-1 or (MTinflection==1 and MTtrend==1 and close <= open) then MTdownWaveVolume[1]+volume else 0;



plot BuySignal = MTinflection[1] and MTdownwavevolume[2] > 0;
BuySignal.SetDefaultColor(Color.Cyan);
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.SetLineWeight(4);

plot SellSignal = MTinflection[1] and MTupwavevolume[2] > 0;
SellSignal.SetDefaultColor(Color.Magenta);
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SellSignal.SetLineWeight(4);

####################
##volume label add-on

##input MTVolumeAudible_Alert = yes;
def MTVolumeDeviation_Length = 60;
def MTVolumeDeviate = 2;
def MTvolumestdevlength = RelativeVolumeStDev(length = MTvolumeDeviation_Length);
def abovedev = MTvolumestdevlength >= MTvolumeDeviate;
def belowdev = MTvolumestdevlength <= MTvolumeDeviate;


def MTvolumeincrease = volume > volume[1];
def MTvolumedevincrease = MTvolumeincrease and abovedev;
def MTvolumedecrease = volume < volume[1];
def MTvolumedevdecrease = MTvolumedecrease and abovedev;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def MTvolumeBuying = V * (C - L) / (H - L);
def MTvolumeSelling = V * (H - C) / (H - L);


input Show_Labels = yes;
AddLabel(Show_Labels, "Buy Vol = " + Round(MTvolumeBuying, 0), if MTvolumeBuying > MTvolumeSelling then color.green else color.red);
AddLabel(Show_Labels, "Sell Vol = " + Round(MTvolumeSelling, 0), if MTvolumeSelling > MTvolumeBuying then color.green else color.red);

Hi, it is programmer from freelancer, please contact me, I converted the indicator

Reply With Quote
 
(login for full post details)
  #6 (permalink)
markmanu
Kansas
 
 
Posts: 6 since Dec 2018
Thanks: 0 given, 1 received


fxprogrammer View Post
Hi, it is programmer from freelancer, please contact me, I converted the indicator

Hi fxprogrammer, thanks for your reply. Can you please show me how you converted the indicator?

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Chosin76
Los Angeles + CA/USA
 
 
Posts: 1 since Jan 2019
Thanks: 1 given, 0 received

What does this strategy do? I code a little bit in EasyLanguage but haven't picked it apart yet.

It looks good on the 5-minute visual test but have you backtested it? TradingView is an easy way to backtest a rough draft.

I am discretionary but have been looking at systematic.

Reply With Quote
 
(login for full post details)
  #8 (permalink)
 kjhosken 
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 90 since Sep 2016
Thanks: 7 given, 32 received

Do you mind posting a picture of what it's supposed to look like? If so I can try to figure it out over the next couple days

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #9 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


markmanu View Post
Hi fxprogrammer, thanks for your reply. Can you please show me how you converted the indicator?

markmanu -
did you have any success using fxprogrammer's version?



fxprogrammer View Post
Hi, it is programmer from freelancer, please contact me, I converted the indicator

fxprogrammer -
hi am also interested in having this converted to tradestation. can you post a screenshot please of your converted version onto a chart (not the code) please before i contact you?

Reply With Quote
 
(login for full post details)
  #10 (permalink)
 kjhosken 
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 90 since Sep 2016
Thanks: 7 given, 32 received


At least on TOS, this indicator will give false signals.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #11 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


kjhosken View Post
At least on TOS, this indicator will give false signals.

yeah i just started watching it this week and have seen a few already, but i would like to test it anyways in tradestation using the yellow line as a stop to try minimize losses.


Reply With Quote
 
(login for full post details)
  #12 (permalink)
 kjhosken 
Seattle, WA/USA
 
Experience: Intermediate
Platform: TOS, TS
Trading: Forex, crude
 
Posts: 90 since Sep 2016
Thanks: 7 given, 32 received

Not a bad idea. If you could attach the logic for that stop to something that gives valid or only confirmed signals it might look really good

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #13 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


kjhosken View Post
Not a bad idea. If you could attach the logic for that stop to something that gives valid or only confirmed signals it might look really good

yep i agree. at the moment im thinking of using ATR as possible confirmation before entry.

Reply With Quote
 
(login for full post details)
  #14 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

How do I convert this in EasyLanguage

#CCI_CLOUDS
declare lower;
input cciLength2 = 5;
input cciAvgLength2 = 3;

input over_Sold = 20;
input over_Bought = 80;

plot OverBought = over_Bought;
OverBought.SetStyle(Curve.LONG_DASH);
plot OverSold = over_Sold;
OverSold.SetStyle(Curve.LONG_DASH);
#--------------------------------------------

plot CCI2 = .5 * CCI(length = cciLength2) + 50;
plot CCIAvg2 = Average(CCI2, cciAvgLength2);
plot CCI3 = ExpAverage(CCI2);
CCI2.SetStyle(Curve.SHORT_DASH);
CCI2.SetDefaultColor(GetColor(6));
CCIAvg2.SetDefaultColor(Color.RED);
CCI3.setDefaultColor(color.yellow);

AddCloud(CCI2, CCIAvg2, Color.GREEN, Color.RED);
AddCloud(CCI2, CCIAvg2, Color.GREEN, Color.RED);
AddCloud(CCIAvg2, CCI3, Color.GREEN, Color.RED);

Reply With Quote
 
(login for full post details)
  #15 (permalink)
 numberjuani 
Agoura Hills, CA USA
 
Experience: Advanced
Platform: Tradestation&Multicharts
Broker: TradeStation
Trading: Futures & Equities
 
numberjuani's Avatar
 
Posts: 127 since Apr 2019
Thanks: 9 given, 98 received

Tell us what the code is doing, and post 3 screenshots. unless somebody knows both languages its unlikely somebody will be able to help. but if you tell us what its doing and how it looks, somebody could help out


markmanu View Post
I'm a trainer and it's a bit complicated for me to convert this thinkscript code to easy language.
Can anyone please help me? Many thanks



declare upper;

input avglength = 14;
input MTaverageType = AverageType.WILDERS;
input ATRLength = 5;
input MTprice = hlc3;
input MTreversalMode = {default ATRpercent, price};
input MTreversalAmount = .5;

##DayATR Value Calculation
def highPrice = FundamentalType.high;
def closePrice = FundamentalType.close;
def lowPrice = FundamentalType.low;
def aggregationPeriod = AggregationPeriod.DAY;
rec AvgTrueRange = MovingAverage(AverageType.SIMPLE, TrueRange(Fundamental (highPrice, period = AggregationPeriod.Day), Fundamental (closePrice, period = AggregationPeriod.DAY), Fundamental (lowPrice, period = AggregationPeriod.DAY) ),ATRlength);

##############
##ATR percent conversion calculation
rec DayATRReversalValue = MTreversalAmount*(AvgTrueRange/close)*100;

def mode = if MTreversalMode == MTreversalMode.price then ZigZagTrendSign(price = MTprice, reversalAmount=MTreversalAmount) else ZigZagTrendPercent(price = MTprice, reversalAmount=DayATRReversalValue);
def MTinflection = if MTreversalMode == MTreversalMode.price then if !isNan(ZigZagSign(price = MTprice, reversalAmount=MTreversalAmount)) then 1 else 0 else if !isNan(ZigZagPercent(price = MTprice, reversalAmount=DayATRReversalValue)) then 1 else 0;
rec MTtrend = if MTinflection==1 and mode ==-1 then 1 else if MTinflection==1 and mode==1 then -1 else MTtrend[1];

rec MTupWaveVolume = if MTinflection==1 and MTtrend==1 and close>open then volume else if MTinflection==1 and MTtrend==1 and close <= open then 0 else if MTtrend==1 or (MTinflection==1 and MTtrend ==-1 and close>=open) then MTupWaveVolume[1]+volume else 0;
rec MTdownWaveVolume = if MTinflection==1 and MTtrend ==-1 and close<open then volume else if MTinflection==1 and MTtrend ==-1 and close>=open then 0 else if MTtrend==-1 or (MTinflection==1 and MTtrend==1 and close <= open) then MTdownWaveVolume[1]+volume else 0;



plot BuySignal = MTinflection[1] and MTdownwavevolume[2] > 0;
BuySignal.SetDefaultColor(Color.Cyan);
BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BuySignal.SetLineWeight(4);

plot SellSignal = MTinflection[1] and MTupwavevolume[2] > 0;
SellSignal.SetDefaultColor(Color.Magenta);
SellSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SellSignal.SetLineWeight(4);

####################
##volume label add-on

##input MTVolumeAudible_Alert = yes;
def MTVolumeDeviation_Length = 60;
def MTVolumeDeviate = 2;
def MTvolumestdevlength = RelativeVolumeStDev(length = MTvolumeDeviation_Length);
def abovedev = MTvolumestdevlength >= MTvolumeDeviate;
def belowdev = MTvolumestdevlength <= MTvolumeDeviate;


def MTvolumeincrease = volume > volume[1];
def MTvolumedevincrease = MTvolumeincrease and abovedev;
def MTvolumedecrease = volume < volume[1];
def MTvolumedevdecrease = MTvolumedecrease and abovedev;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def MTvolumeBuying = V * (C - L) / (H - L);
def MTvolumeSelling = V * (H - C) / (H - L);


input Show_Labels = yes;
AddLabel(Show_Labels, "Buy Vol = " + Round(MTvolumeBuying, 0), if MTvolumeBuying > MTvolumeSelling then color.green else color.red);
AddLabel(Show_Labels, "Sell Vol = " + Round(MTvolumeSelling, 0), if MTvolumeSelling > MTvolumeBuying then color.green else color.red);


Reply With Quote
 
(login for full post details)
  #16 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


StockT8er View Post
How do I convert this in EasyLanguage

#CCI_CLOUDS

see below... sorry dont know how to do the clouds portion, only the indicator.

 
Code
inputs:
	cciLength2(5),
	cciAvgLength2(3),
	over_sold(80),
	over_bought(20);
	
vars:
	cci2(0),
	cciAvg2(0),
	cci3(0);

cci2 = 0.5 * CCI(cciLength2) + 50;
cciAvg2 = Average(cci2, cciAvgLength2);
cci3 = Xaverage(cci2, 12);

plot1(cci2, "cci2");
plot2(cciAvg2, "cciAvg2");
plot3(cci3, "cci3");
plot4(over_bought, "overbought");
plot5(over_sold, "oversold");

Reply With Quote
The following user says Thank You to mntman for this post:
 
(login for full post details)
  #17 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

Thanks don't need cloud

The Swing Trade script works great, just don't get the bottom bar portion, not in your script

Reply With Quote
 
(login for full post details)
  #18 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

This would be Fantastic if you could get it to work during available trading hours
I include a script to add trading hrs, just not sure how to incorporate it into your script

input usetimefilter = yes;

#positioning
input rthopen = 0930;
input rthclose = 1600;
def RTH = if usetimefilter == yes then if SecondsFromTime(rthopen) >= 0 and
SecondstillTime(rthclose) >= 0
then 1
else 0 else 1;

Also would be nice if when it's getting close to triggering was to send an Alert

THIS IS A MONEY MAKER

Reply With Quote
 
(login for full post details)
  #19 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

In running your Study, it seams to have a sight flaw. The Buy Point and the Sell Point keep changing
In Order to use this as a strategy you need to have it readjust after an accrual BUY or SELL

Reply With Quote
 
(login for full post details)
  #20 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

Do you know how to fix this

def colorB = if isLastBar = (Color.GREEN) and color.CURRENT = (Color.DARK_GREEN) then 1 else 0;
def colorS = if isLastBar = (Color.RED) and color.CURRENT = (Color.DARK_RED) then 1 else 0;

Reply With Quote
 
(login for full post details)
  #21 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

I can not help you, however could someone convert this. It sets up the time for a strategy to run. Is also from TOS

{positioning}
inputs:
{aggregationPeriod( Aggregation.Day ),
showOnlyLastPeriod( yes ),}
rthopen = From( 0645 ),
rthclose = To( 1555 );

RTH = if usetimefilter == yes then if SecondsFromTime(rthopen) >= 0 and
SecondsTillTime(rthclose) >= 0
then 1
else 0 else 1;

Reply With Quote
 
(login for full post details)
  #22 (permalink)
madeinnyc
Highland Park, TX
 
 
Posts: 27 since Jan 2020
Thanks: 15 given, 15 received


mntman View Post
yeah i just started watching it this week and have seen a few already, but i would like to test it anyways in tradestation using the yellow line as a stop to try minimize losses.


How did you get the lower volume study to plot with a histogram view and bubbles? Thanks!

Reply With Quote
 
(login for full post details)
  #23 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

This is a cool chart. Would love the code

Reply With Quote
 
(login for full post details)
  #24 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


madeinnyc View Post
How did you get the lower volume study to plot with a histogram view and bubbles? Thanks!


StockT8er View Post
This is a cool chart. Would love the code

below is a link to the lower study version i made:

https://tos.mx/H24E40j

Reply With Quote
The following 2 users say Thank You to mntman for this post:
 
(login for full post details)
  #25 (permalink)
madeinnyc
Highland Park, TX
 
 
Posts: 27 since Jan 2020
Thanks: 15 given, 15 received


mntman View Post
below is a link to the lower study version i made:

https://tos.mx/H24E40j

Very nice of you to share! Plots great on the 1 hour. Does it repaint? Any settings to make it work on a Renko chart?

Reply With Quote
 
(login for full post details)
  #26 (permalink)
 Skidboot 
Houston, TX
 
 
Skidboot's Avatar
 
Posts: 196 since Dec 2010
Thanks: 199 given, 283 received


madeinnyc View Post
Very nice of you to share! Plots great on the 1 hour. Does it repaint? Any settings to make it work on a Renko chart?

Yes, it does repaint. Too good to be a real deal .

Reply With Quote
The following user says Thank You to Skidboot for this post:
 
(login for full post details)
  #27 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received

skidboot is correct it does repaint unfortunately.

im not sure how to make it work on renkos (assuming you still wanted to test it). the error says "Secondary subscriptions are not allowed on range charts" so it may have something to do with the atr aggregation day period at lines 13-19, not really sure.
 
Code
##DayATR Value Calculation
def highPrice = FundamentalType.high;
def closePrice = FundamentalType.close;
def lowPrice = FundamentalType.low;
def aggregationPeriod = AggregationPeriod.DAY;
rec AvgTrueRange = MovingAverage(AverageType.SIMPLE, TrueRange(Fundamental (highPrice, period = AggregationPeriod.Day), Fundamental (closePrice, period = AggregationPeriod.DAY), Fundamental (lowPrice, period = AggregationPeriod.DAY) ),ATRlength);

Reply With Quote
The following user says Thank You to mntman for this post:
 
(login for full post details)
  #28 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

Thanks
I guess this does mot paint the upper chart? Upper chart adds to it alot

I tried to convert this to a strategy, not sure why it does not work. I relies that it mite not back test very well due to that it has to rec. however I thought that if iI let it run it would at least let me know how much I would have made if I would have used it. does not seam to buy and sell like normal strategies do.

I guess the Buysignal and Sellsignal are N/A

Reply With Quote
 
(login for full post details)
  #29 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

After running your study live I realized it keeps changing the buy and sell bubbles to meet the perfect condition. Refer to pictures below
Annotation 2020-06-19 072044


Annotation 2020-06-19 072045


you need it to be consitant give you a sell bubble, and if it wants you back in, then give you another buy bubble. see my strat
Annotation 2020-06-19 072509

Reply With Quote
 
(login for full post details)
  #30 (permalink)
 mntman 
Houston+TX/USA
 
Experience: Intermediate
Platform: TradeStation, ThinkorSwim
Trading: ES, CL
 
mntman's Avatar
 
Posts: 11 since Jan 2019
Thanks: 1 given, 4 received


StockT8er View Post
After running your study

actually i didn't write the script dude, the original script is found on page 1. all i did was edit it to view in a lower study to help me start watching it to see whats its doing with volume. if you have any questions about what the original does its prob best to ask markmanu who was first to post it.


StockT8er View Post
it keeps changing the buy and sell bubbles to meet the perfect condition

yeah thats what skidboots was pointing out... the study "repaints" so signals will appear or disappear depending on if still valid. they dont hold in place so its not possible (at least not as written) to see the valid true trades. i stopped watching it because of this. like he said "Too good to be a real deal"

Reply With Quote
 
(login for full post details)
  #31 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

That makes since. I go the paint to work at the bottom just not on the chart. But don;t do any goo if don't work just looks pretty

Reply With Quote
 
(login for full post details)
  #32 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

WOW Why do some people take the time to create a study or strategy that looks to the past or future, anyone can look at a past chart and pick the lows and highs to have bought at. and see what they could have made.

Reply With Quote
 
(login for full post details)
  #33 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

OK I have a though, the above script does not really work to set up an accurate buy or sell. however it may help in another way. What if you use this script to activate another. Like when this is is the Buy or up momentum BullishPosture you trigger Buy and Sell Signals using the reg MACD and then when in the Sell or BearsihPosture you trigger Buy and Sell Signals using the RevMACD. Therefor catching both directions.
I'm not up on the code well enough and I can not find coding information to write coding to do this. Or maybe there's a better way to script Bull market and Bear markets to rev from MACD to RevMACD. and back again, as the market changes.
Example
Reg Avg[1] < Avg and Avg[2] < Avg[1]
Rev Avg[1] > Avg and Avg[2] > Avg[1]

Reply With Quote
 
(login for full post details)
  #34 (permalink)
 StockT8er 
ROY, Utah
 
Experience: Intermediate
Platform: TradeStation
 
Posts: 81 since Apr 2020
Thanks: 11 given, 6 received

This is a simple MACD Histogram for ToS. Main difference between it and TradeStations is the multi-colors
I've tried to convert, not sure how to do the multi-color portion


declare lower;

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input showBreakoutSignals = no;

plot Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
plot UpSignal = if Diff crosses above 0 then 0 else Double.NaN;
plot DownSignal = if Diff crosses below 0 then 0 else Double.NaN;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

Attached Thumbnails
Click image for larger version

Name:	Screenshot 2020-09-27 095402.png
Views:	33
Size:	6.8 KB
ID:	305290  
Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > Thinkscript to EasyLanguage


Last Updated on September 27, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts