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


Polychromatic conversion to trade station
Updated: Views / Replies:2,987 / 21
Created: by anahat Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you dont need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Polychromatic conversion to trade station

  #1 (permalink)
Trading Apprentice
pinole california
 
Futures 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...

Reply With Quote
The following user says Thank You to anahat for this post:
 
  #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.

 
  #3 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,070 since Aug 2011
Thanks: 2,232 given, 1,729 received


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

Reply With Quote
The following user says Thank You to Nicolas11 for this post:
 
  #4 (permalink)
Fortitudo et Honor
Austin, TX
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 703 received

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."
Reply With Quote
 
  #5 (permalink)
Trading Apprentice
pinole california
 
Futures 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

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
pinole california
 
Futures Experience: Advanced
Platform: tos
Favorite Futures: options
 
Posts: 16 since Jul 2012
Thanks: 0 given, 1 received

oh and output plot = num/denom

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
pinole california
 
Futures 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..

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
pinole california
 
Futures 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);

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
pinole california
 
Futures Experience: Advanced
Platform: tos
Favorite Futures: options
 
Posts: 16 since Jul 2012
Thanks: 0 given, 1 received

so these are the results on apple daily charts for 3 years.. i started with an account balance of 50,000 and allowed a max allocation of 10,000 dollars per trade and these are for long entries only not short entries i havent gotten to short entry programming yet

buy at .2 sell at -.04 might need another filter to improve accuracy
TradeStation Performance Summary

All Trades
Long Trades
Short Trades

Total Net Profit $36,187.00 $36,187.00 $0.00
Gross Profit $55,050.00 $55,050.00 $0.00
Gross Loss ($18,863.00) ($18,863.00) $0.00
Profit Factor 2.92 2.92 n/a

Roll Over Credit $0.00 $0.00 $0.00
Open Position P/L $1,865.00 $1,865.00 $0.00

Select Total Net Profit $31,074.00 $31,074.00 $0.00
Select Gross Profit $45,465.00 $45,465.00 $0.00
Select Gross Loss ($14,391.00) ($14,391.00) $0.00
Select Profit Factor 3.16 3.16 n/a

Adjusted Total Net Profit $22,278.12 $22,278.12 $0.00
Adjusted Gross Profit $45,162.73 $45,162.73 $0.00
Adjusted Gross Loss ($22,884.61) ($22,884.61) $0.00
Adjusted Profit Factor 1.97 1.97 n/a

Total Number of Trades 67 67 0
Percent Profitable 46.27% 46.27% 0.00%
Winning Trades 31 31 0
Losing Trades 22 22 0
Even Trades 14 14 0

Avg. Trade Net Profit $540.10 $540.10 $0.00
Avg. Winning Trade $1,775.81 $1,775.81 $0.00
Avg. Losing Trade ($857.41) ($857.41) $0.00
Ratio Avg. Win:Avg. Loss 2.07 2.07 n/a
Largest Winning Trade $9,585.00 $9,585.00 $0.00
Largest Losing Trade ($4,472.00) ($4,472.00) $0.00
Largest Winner as % of Gross Profit 17.41% 17.41% n/a
Largest Loser as % of Gross Loss 23.71% 23.71% n/a

Net Profit as % of Largest Loss 809.19% 809.19% n/a
Select Net Profit as % of Largest Loss 694.86% 694.86% n/a
Adjusted Net Profit as % of Largest Loss 498.17% 498.17% n/a

Max. Consecutive Winning Trades 6 6 0
Max. Consecutive Losing Trades 4 4 0
Avg. Bars in Total Trades 9.31 9.31 0.00
Avg. Bars in Winning Trades 12.42 12.42 0.00
Avg. Bars in Losing Trades 10.23 10.23 0.00
Avg. Bars in Even Trades 1.00 1.00 0.00

Max. Shares/Contracts Held 100 100 0
Total Shares/Contracts Held 6800 6800 0
Account Size Required $5,775.00 $5,775.00 $0.00
Total Slippage $0.00 $0.00 $0.00
Total Commission $0.00 $0.00 $0.00

Return on Initial Capital 36.19%
Annual Rate of Return 11.03%
Buy & Hold Return 223.04%
Return on Account 626.61%
Avg. Monthly Return $1,119.18
Std. Deviation of Monthly Return $2,344.43

Return Retracement Ratio 0.50
RINA Index 32.96
Sharpe Ratio 0.40
K-Ratio 2.49

Trading Period 2 Yrs, 9 Mths, 18 Dys
Percent of Time in the Market 79.67%
Time in the Market 2 Yrs, 2 Mths, 23 Dys
Longest Flat Period 30 Dys

Max. Equity Run-up $40,844.00
Date of Max. Equity Run-up 04/10/12 13:00
Max. Equity Run-up as % of Initial Capital 40.84%

Max. Drawdown (Intra-day Peak to Valley)
Value ($11,534.00) ($11,534.00) $0.00
Date 05/18/12 13:00
as % of Initial Capital 11.53% 11.53% 0.00%
Net Profit as % of Drawdown 313.74% 313.74% n/a
Select Net Profit as % of Drawdown 269.41% 269.41% n/a
Adjusted Net Profit as % of Drawdown 193.15% 193.15% n/a

Max. Drawdown (Trade Close to Trade Close)
Value ($5,775.00) ($5,775.00) $0.00
Date 05/22/12 13:00
as % of Initial Capital 5.78% 5.78% 0.00%
Net Profit as % of Drawdown 626.61% 626.61% n/a
Select Net Profit as % of Drawdown 538.08% 538.08% n/a
Adjusted Net Profit as % of Drawdown 385.77% 385.77% n/a

Max. Trade Drawdown ($8,561.00) ($8,561.00) $0.00



All Trades

Total Net Profit $36,187.00 Profit Factor 2.92
Gross Profit $55,050.00 Gross Loss ($18,863.00)

Roll Over Credit $0.00
Open Position Profit/Loss $1,865.00

Select Total Net Profit $31,074.00 Select Profit Factor 3.16
Select Gross Profit $45,465.00 Select Gross Loss ($14,391.00)

Adjusted Total Net Profit $22,278.12 Adjusted Profit Factor 1.97
Adjusted Gross Profit $45,162.73 Adjusted Gross Loss ($22,884.61)

Total Number of Trades 67 Percent Profitable 46.27%
Winning Trades 31 Losing Trades 22
Even Trades 14

Avg. Trade Net Profit $540.10 Ratio Avg. Win:Avg. Loss 2.07
Avg. Winning Trade $1,775.81 Avg. Losing Trade ($857.41)
Largest Winning Trade $9,585.00 Largest Losing Trade ($4,472.00)
Largest Winner as % of Gross Profit 17.41% Largest Loser as % of Gross Loss 23.71%

Net Profit as % of Largest Loss 809.19%
Slct. Net Profit as % of Largest Loss 694.86% Adj. Net Profit as % of Largest Loss 498.17%

Max. Consecutive Winning Trades 6 Max. Consecutive Losing Trades 4
Avg. Bars in Winning Trades 12.42 Avg. Bars in Losing Trades 10.23
Avg. Bars in Total Trades 9.31

Max. Shares/Contracts Held 100 Account Size Required $5,775.00
Total Commission $0.00 Total Slippage $0.00

Return on Initial Capital 36.19% Annual Rate of Return 11.03%
Buy and Hold Return 223.04% Return on Account 626.61%
Avg. Monthly Return $1,119.18 Std. Deviation of Monthly Return $2,344.43

Return Retracement Ratio 0.50 RINA Index 32.96
Sharpe Ratio 0.40 K-Ratio 2.49

Trading Period 2 Yrs, 9 Mths, 18 Dys Percent of Time in the Market 79.67%
Time in the Market 2 Yrs, 2 Mths, 23 Dys Longest Flat Period 30 Dys

Max. Equity Run-up $40,844.00
Date of Max. E. Run-up 04/10/12 13:00 Max. E. Run-up as % of Initial Capital 40.84%

Max. Drawdown (Intra-day Peak to Valley)
Max. Drawdown (Trade Close to Trade Close)

Value ($11,534.00) Value ($5,775.00)
Date 05/18/12 13:00 Date 05/22/12 13:00
as % of Initial Capital 11.53% as % of Initial Capital 5.78%
Net Profit as % of Drawdown 313.74% Net Profit as % of Drawdown 626.61%
Slct. Net Profit as % of Drawdown 269.41% Slct. Net Profit as % of Drawdown 538.08%
Adj. Net Prof as % of Drawdown 193.15% Adj. Net Profit as % of Drawdown 385.77%

Max. Trade Drawdown ($8,561.00)

Long Trades

Total Net Profit $36,187.00 Profit Factor 2.92
Gross Profit $55,050.00 Gross Loss ($18,863.00)

Roll Over Credit $0.00
Open Position Profit/Loss $1,865.00

Select Total Net Profit $31,074.00 Select Profit Factor 3.16
Select Gross Profit $45,465.00 Select Gross Loss ($14,391.00)

Adjusted Total Net Profit $22,278.12 Adjusted Profit Factor 1.97
Adjusted Gross Profit $45,162.73 Adjusted Gross Loss ($22,884.61)

Total Number of Trades 67 Percent Profitable 46.27%
Winning Trades 31 Losing Trades 22
Even Trades 14

Avg. Trade Net Profit $540.10 Ratio Avg. Win:Avg. Loss 2.07
Avg. Winning Trade $1,775.81 Avg. Losing Trade ($857.41)
Largest Winning Trade $9,585.00 Largest Losing Trade ($4,472.00)
Largest Winner as % of Gross Profit 17.41% Largest Loser as % of Gross Loss 23.71%

Max. Consecutive Winning Trades 6 Max. Consecutive Losing Trades 4
Avg. Bars in Winning Trades 12.42 Avg. Bars in Losing Trades 10.23
Avg. Bars in Total Trades 9.31

Max. Shares/Contracts Held 100 Account Size Required $5,775.00
Total Commission $0.00 Total Slippage $0.00

Net Profit as % of Largest Loss 809.19%
Slct. Net Profit as % of Largest Loss 694.86% Adj. Net Profit as % of Largest Loss 498.17%

Max. Drawdown (Intra-day Peak to Valley)
Max. Drawdown (Trade Close to Trade Close)

Value ($11,534.00) Value ($5,775.00)
as % of Initial Capital 11.53% as % of Initial Capital 5.78%
Net Profit as % of Drawdown 313.74% Net Profit as % of Drawdown 626.61%
Slct. Net Profit as % of Drawdown 269.41% Slct. Net Profit as % of Drawdown 538.08%
Adj. Net Prof as % of Drawdown 193.15% Adj. Net Profit as % of Drawdown 538.08%

Max. Trade Drawdown ($8,561.00)

Short Trades

Total Net Profit $0.00 Profit Factor n/a
Gross Profit $0.00 Gross Loss $0.00

Roll Over Credit $0.00
Open Position Profit/Loss $0.00

Select Total Net Profit $0.00 Select Profit Factor n/a
Select Gross Profit $0.00 Select Gross Loss $0.00

Adjusted Total Net Profit $0.00 Adjusted Profit Factor n/a
Adjusted Gross Profit $0.00 Adjusted Gross Loss $0.00

Total Number of Trades 0 Percent Profitable 0.00%
Winning Trades 0 Losing Trades 0
Even Trades 0

Avg. Trade Net Proft $0.00 Ratio Avg. Win:Avg. Loss n/a
Avg. Winning Trade $0.00 Avg. Losing Trade $0.00
Largest Winning Trade $0.00 Largest Losing Trade $0.00
Largest Winner as % of Gross Profit n/a Largest Loser as % of Gross Loss 23.71%

Max. Consecutive Winning Trades 0 Max. Consecutive Losing Trades 0
Avg. Bars in Winning Trades 0.00 Avg. Bars in Losing Trades 0.00
Avg. Bars in Total Trades 0.00

Max. Shares/Contracts Held 0 Account Size Required $0.00
Total Slippage $0.00 Total Commission $0.00

Net Profit as % of Largest Loss n/a
Slct. Net Profit as % of Largest Loss n/a Adj. Net Profit as % of Largest Loss n/a

Max. Drawdown (Intra-day Peak to Valley)
Max. Drawdown (Trade Close to Trade Close)

Value $0.00 Value $0.00
as % of Initial Capital 0.00% as % of Initial Capital 0.00%
Net Profit as % of Drawdown n/a Net Profit as % of Drawdown n/a
Slct. Net Profit as % of Drawdown n/a Slct. Net Profit as % of Drawdown n/a
Adj. Net Prof as % of Drawdown n/a Adj. Net Prof as % of Drawdown n/a

Max. Trade Drawdown $0.00



of note i wonder if there is a command that lets you buy a certain option at the time of long entry

Reply With Quote
 
  #10 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,070 since Aug 2011
Thanks: 2,232 given, 1,729 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?

Reply With Quote

Reply



futures io > > > > > Polychromatic conversion to trade station

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
PD: Teenager Tried To Rob Officer At Police Station kbit Off-Topic 5 June 6th, 2012 03:13 PM
DoubleMAPaintHolyGrail for Trade Station westsider The Elite Circle 2 January 14th, 2012 08:22 PM
Russia Retaliates Against US: Puts Radar Station On Combat Alert, Prepares To Take Ou Quick Summary News and Current Events 0 November 24th, 2011 03:50 AM
First Pipeline-Fed Hydrogen Refueling Station Opens in the United States kbit News and Current Events 0 May 16th, 2011 11:24 PM
Trade Station to NT 7 suggestions please thinkfuture Traders Hideout 2 September 10th, 2010 03:27 PM


All times are GMT -4. The time now is 07:02 PM.

Copyright © 2017 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
Page generated 2017-12-14 in 0.16 seconds with 19 queries on phoenix via your IP 54.226.227.175