Turtle TS-code help needed from programmers - EasyLanguage Programming | futures io social day trading
futures io futures trading

Turtle TS-code help needed from programmers
Updated: Views / Replies:3,176 / 1
Created: by abcplot 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 100,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 don’t 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

Thread Tools Search this Thread

Turtle TS-code help needed from programmers

  #1 (permalink)
Trading Apprentice
Trading Experience: Intermediate
Platform: Tradestation
Favorite Futures: Gold
Posts: 14 since May 2011
Thanks: 6 given, 2 received

Turtle TS-code help needed from programmers


I am relatively new to Tradestation and would need some help from expierenced TS programmers in understanding below attached Turtle strategy.

I am hoping that there are some members which can help me to fully understand below code.

Below is the first part of mentioned Turtle strategy attached, including my comments as I think the instrcutions will be executed, on some statements I simply have no clue what they are really doing, hopefully some members can explain them in detail.

Currently I donīt think it makes sense to post the entire strategy, so I will go ahead and post below the first part

In BLUE are my comments, as I said, would be great if somebody can tell me if my analysis of below code is correct and on sections where I simply donīt know whats going on if possible please provide some further assistance.

Thanks a lot to everbody!

Below are the first 30% of given TS code:

[LegacyColorValue = true];
{ Turtle mode #2 Ver.0.1.0 03.02.2005}

Input: DistH(4),DistL(4),Account(10000),MaxPercRisk(1),MaxOpenEntry(4);





if Barnumber=1 then begin {Start with 1 bar on chart}
VALUE29=-1; {Numeric value set to -1, for later usage, currently donīt know the meaning of -1}
VALUE38=-1; {Numeric value set to -1, for later usage, currently donīt know the meaning of -1}

{"CurrentEntries" -->numbers of entries currentlyopen, assigned to"cCurrentEntires"}

{AvgEntryPrice --> Average price of all currently open entries --> assigned to "cAvgEntryPrice"}

{CurrentContracts --> Number of contracts currently open --> assigned to "cCurrentContracts"}

if (cCurrentEntries>cCurrentEntries[1]) then begin
{(cCurrentEntries>cCurrentEntries[1]) --> if "cCurrentEntries" is bigger that the one from yesterday, but so far there are no trades made, value for both is still 0, condition not met, jump to next "if" --> if (cCurrentEntries=0 and cCurrentEntries[1]<>0) then begin}

cEntryPrice=(CurrentContracts*AvgEntryPrice-cCurrentContracts[1]*cAvgEntryPrice[1]) / (CurrentContracts-cCurrentContracts[1]);
{Calculation for var "cEntryprice" --> (Number of currently held contracts * average price of all currently open entries) - ( values from yesterday) / (currently held contract - the ones from yesterday)}

--> same thing: currently no trades in progress, all vars still set to 0
--> What does "cEntryPrice" basically say? actually donīt understand the meaning of this calculation.

if MarketPosition=1 then begin
{ if long than continue --> condition not met, no trades in progress}

{ I guess thatīs the "2N" initial stop calculation according to Turtle rules}

{no idea...., whats the meaning of this "NextHigh"?}

{no idea...., whats the meaning of this "NextHigh"?}

{predefined vars, as above. Whatīs the reason to have them all on -1?)

{predefined vars, as above)

{predefined vars, as above)

{predefined vars, as above)

else begin
SExitStop=TicksRound(cEntryPrice+2*XAverage(TrueRange,20)); {same as above, just SExit)
NextLow=cEntryPrice-0.5*XAverage(TrueRange,20); {no idea...., whats the meaning of this?}
NextLow=TicksRound(NextLow-TicksMTS(NextLow)); {no idea...., whats the meaning of this?}
{predefined vars, as above. Whatīs the reason to have them all on -1?)
SellLimit=-1; {predefined vars, as above)
BarUntil=-1; {predefined vars, as above)
VALUE38=-1; {predefined vars, as above)

{ Date & Time line for multiple entries Buy / Sell }
value99=date; {predefined numeric values --> date}
value98=time; {predefined numeric value --> time}

if (cCurrentEntries=0 and cCurrentEntries[1]<>0) then begin
{cCurrentEntries is 0, but cCurrentEnties from yesterday is equal to 0 --> condition not met to proceed, so far no trades made}

if VALUE29>=0 then {so far value29 is still set to 0, cannot proceed}

TL_Delete(VALUE29); {delete trendline}

{in case value29 changed --> now re-setting "value29" to -1}
if VALUE38>=0 then {so far value38 is still set to 0, cannot proceed}
TL_Delete(VALUE38); {delete trendline}
VALUE38=-1; {in case value38 changed --> now re-setting "value38" to -1}

Reply With Quote
  #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.


futures io > > > > > Turtle TS-code help needed from programmers

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

Journal Challenge $1600 in Prizes & Free Journalytix for all participants!


3 Excellent Entries, and How To Automate Them w/Kevin Davey

Feb 21

The Driving Force Behind the Market w/Earn2Trade

Mar 5

TBA w/Stage5 & iSystems

Mar 12

TBA w/John Grady @ No BS Day Trading

Mar 19

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

Mar 26

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rubber Band Indicator & TS Code TheWizard NinjaTrader Programming 8 May 20th, 2012 03:35 PM
Code Snippets needed! zeller4 NinjaTrader Programming 11 June 20th, 2011 04:21 PM
Turtle Trading System Calculation Help wanted JVentura Platforms and Indicators 2 November 22nd, 2010 09:27 PM
Just a little code assist needed for entry filter Trader.Jon NinjaTrader Programming 2 October 27th, 2010 02:25 PM
any ninjatrader programmers who can code simple strategies? mystiq NinjaTrader Programming 4 July 8th, 2010 10:45 AM

average, barnumber, code, delete, easylanguage, information, marketposition, multicharts, neoticker, strategy, tradestation, trendline, trendlines, values, xaverage

All times are GMT -4. The time now is 04:01 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2019-02-22 in 0.19 seconds with 15 queries on phoenix