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:2,812 / 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 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 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

Reply
 
Thread Tools Search this Thread
 

Turtle TS-code help needed from programmers

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

Turtle TS-code help needed from programmers

Hello,


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);

Var:TradeAccount(-1),PosSize(0),TrailBars(10),CurrentPosition(0),cCurrentEntries(0),
cAvgEntryPrice(0),cEntryPrice(0),cCurrentContracts(0);

Var:BuyStop(-1),BuyLimit(-1),LExitStop(-1),SellStop(-1),SellLimit(-1),SExitStop(-1);

Var:NextHigh(-1),NextLow(-1),BarUntil(-1);

Var:BreakType(0),BreakStop(-1),BreakBars(0),BreakIsLoss(false),Break20Found(false),Break20SkipCnt(0);


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}
end;

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



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

cCurrentContracts=CurrentContracts;
{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}

LExitStop=TicksRound(cEntryPrice-2*XAverage(TrueRange,20));
{ I guess thatīs the "2N" initial stop calculation according to Turtle rules}

NextHigh=cEntryPrice+0.5*XAverage(TrueRange,20);
{no idea...., whats the meaning of this "NextHigh"?}

NextHigh=TicksRound(NextHigh+TicksMTS(NextHigh));
{no idea...., whats the meaning of this "NextHigh"?}

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

BuyLimit=-1;
{predefined vars, as above)

BarUntil=-1;
{predefined vars, as above)

VALUE29=-1;
{predefined vars, as above)
end


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?}
SellStop=-1;
{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)
end;

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


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}
NextHigh=-1;
NextLow=-1;
LExitStop=-1;
SExitStop=-1;
BuyStop=-1;
BuyLimit=-1;
SellStop=-1;
SellLimit=-1;
BarUntil=-1;


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

TL_Delete(VALUE29); {delete trendline}

VALUE29=-1;
{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}
end;

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.


Reply



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

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
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


All times are GMT -4. The time now is 02:31 AM.

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.08 seconds with 19 queries on phoenix via your IP 54.221.76.68