Polychromatic conversion to trade station - EasyLanguage Programming | futures io social day trading

 Updated: February 24th, 2018 (11:01 PM) Views / Replies: 3,737 / 22 Created: August 7th, 2012 (11:26 PM) by anahat Attachments: 0

 Welcome to futures io.

# Polychromatic conversion to trade station

 August 7th, 2012, 11:26 PM #1 (permalink) Trading Apprentice pinole california   Trading Experience: Advanced Platform: tos Favorite Futures: options   Posts: 16 since Jul 2012 Thanks: 0 given, 1 received Polychromatic conversion to trade station hello everybody, You know i found a very interesting indicator while i was on think or swim, currently i am trying to back test the validity of this indicator with trade station but i am having a hell of a time getting the conversion of it.. here is the tos code declare lower; input price = close; input length = 8; input bxo = 0.2; input sxo = -0.04; def num = fold indexN = 1 to length + 1 with accuN do accuN + (price - getValue(price, indexN, length)) / Sqrt(indexN); def denom = fold indexD = 1 to length + 1 with accuD do accuD + Sqrt(indexD); i get all the basics of it ie.. def num . sxo .. bxo sqrt, but what i am having trouble with is the index and accu functions i would appreciate the help guys thanks...
 The following user says Thank You to anahat for this post:

 August 7th, 2012, 11:26 PM #2 (permalink) Quick Summary Quick Summary Post Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

Elite Member
near Paris, France

Platform: -
Favorite Futures: -

Posts: 1,071 since Aug 2011

Hi,

Some initial disclaimers:

- I have never used ThinkOrSwim. I have just found the syntax of fold and getValue on Internet.

- I am not sure to have understood the syntax of getValue.

- I have never used TradeStation. The code below is for MultiCharts. But should be the same.

- Due to the above, you absolutely need to compare ThinkOrSwim results and Trade Station results, in order to check that there is no coding error.

- The code below could be optimized a little (less variables). But I wanted to better show the correspondence in the conversion.

ThinkOrSwim:

Code
 ```input price = close; input length = 8; def num = fold indexN = 1 to length + 1 with accuN do accuN + (price - getValue(price, indexN, length)) / Sqrt(indexN); def denom = fold indexD = 1 to length + 1 with accuD do accuD + Sqrt(indexD);```
Possible code for MultiCharts / Trade Station:

Code
 ```Inputs: price ( Close ), length ( 8 ); Variables: num ( 0 ), indexN ( 0 ), accuN ( 0 ), denom ( 0 ), indexD ( 0 ), accuD ( 0 ), offset ( 0 ); accuN = 0; for indexN = 1 to length+1 begin if indexN > length then offset = length else offset = indexN; accuN = accuN + (price - price[offset]) / SquareRoot(indexN); end; num = accuN; accuD = 0; for indexD = 1 to length+1 begin accuD = accuD + SquareRoot(indexD); end; denom = accuD;```
Nicolas

 The following user says Thank You to Nicolas11 for this post:

Fortitudo et Honor
Austin, TX

Favorite Futures: Futures

Posts: 882 since Mar 2011

So what is the output/plot? "denom"?

 "A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."

 August 8th, 2012, 01:14 PM #5 (permalink) Trading Apprentice pinole california   Trading Experience: Advanced Platform: tos Favorite Futures: options   Posts: 16 since Jul 2012 Thanks: 0 given, 1 received thanks nicolas i am going to get this into tradestation double check today and you know what i am a even going to post the stats of this indicator here prolly tonight

 August 8th, 2012, 01:16 PM #6 (permalink) Trading Apprentice pinole california   Trading Experience: Advanced Platform: tos Favorite Futures: options   Posts: 16 since Jul 2012 Thanks: 0 given, 1 received oh and output plot = num/denom

 August 8th, 2012, 01:17 PM #7 (permalink) Trading Apprentice pinole california   Trading Experience: Advanced Platform: tos Favorite Futures: options   Posts: 16 since Jul 2012 Thanks: 0 given, 1 received declare lower; input price = close; input length = 8; input bxo = 0.2; input sxo = -0.04; def num = fold indexN = 1 to length + 1 with accuN do accuN + (price - getValue(price, indexN, length)) / Sqrt(indexN); def denom = fold indexD = 1 to length + 1 with accuD do accuD + Sqrt(indexD); plot PM = num / denom; plot BuyLevel = bxo; plot SellLevel = sxo; PM.SetDefaultColor(GetColor(8)); BuyLevel.SetDefaultColor(GetColor(5)); SellLevel.SetDefaultColor(GetColor(1)); here is the whole script i apologize friends..

 August 8th, 2012, 02:08 PM #8 (permalink) Trading Apprentice pinole california   Trading Experience: Advanced Platform: tos Favorite Futures: options   Posts: 16 since Jul 2012 Thanks: 0 given, 1 received sorry to keep posting but here is the completed code inputs: Price( Close ), Length( 8 ), GridForegroundColor( Black ) ; { Color to use for numbers in RadarScreen cells when gradient coloring is enabled, that is, when both UpColor and DnColor are set to non-negative values. } { Set either UpColor and/or DnColor to -1 to disable gradient plot coloring. When disabled, Plot1 color is determined by settings in indicator properties dialog box. Plot2 (ZeroLine) color always comes from indicator properties dialog box. } Variables: num ( 0 ), indexN ( 0 ), accuN ( 0 ), denom ( 0 ), indexD ( 0 ), accuD ( 0 ), offset ( 0 ), Pm ( 0 ); accuN = 0; for indexN = 1 to length+1 begin if indexN > length then offset = length else offset = indexN; accuN = accuN + (price - price[offset]) / SquareRoot(indexN); end; num = accuN; accuD = 0; for indexD = 1 to length+1 begin accuD = accuD + SquareRoot(indexD); end; denom = accuD; Plot1( num/Denom, "Momentum" ); plot2(.2,"sxo",Red); Plot3(-.04,"Bxo",Cyan);

 August 8th, 2012, 02:32 PM #10 (permalink) Elite Member near Paris, France   Trading Experience: Beginner Platform: - Favorite Futures: -     Posts: 1,071 since Aug 2011 Thanks: 2,232 given, 1,731 received When you say "max allocation of 10,000 dollars per trade", what do you mean? Is it the size of the position? of the margin required? of the stop-loss?

 futures io > Polychromatic conversion to trade station

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

February

Feb 19

Feb 21

Mar 5

Mar 12

Mar 19

## Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26

 Similar Threads Thread Thread Starter Forum Replies Last Post kbit Off-Topic 5 June 6th, 2012 03:13 PM westsider The Elite Circle 2 January 14th, 2012 08:22 PM Quick Summary News and Current Events 0 November 24th, 2011 03:50 AM kbit News and Current Events 0 May 16th, 2011 11:24 PM thinkfuture Traders Hideout 2 September 10th, 2010 03:27 PM

 Tags adx, ats, average, back test, buy, code, coding, commission, convergence, data, divergence, dow, drawdown, easylanguage, eld, equity curve, es, futures, how to, indicator, indicators, information, intraday, margin, momentum, msft, mt4, multicharts, neoticker, profitable, programming, radarscreen, resistance, retracement, retracements, short, signals, slippage, slope, stop loss, strategy, support, think or swim, thinkorswim, thinkscript, tos, trade station, tradestation, trading, values, volume