NexusFi: Find Your Edge


Home Menu

 





TSSuperTrend Strategy error


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one john2000 with 7 posts (0 thanks)
    2. looks_two Trader.Jon with 4 posts (0 thanks)
    3. looks_3 jabeztrading with 3 posts (5 thanks)
    4. looks_4 tarantino with 3 posts (0 thanks)
      Best Posters
    1. looks_one jabeztrading with 1.7 thanks per post
    2. looks_two Zoethecus with 1 thanks per post
    3. looks_3 rptrader with 0.7 thanks per post
    4. looks_4 Azzzz with 0.3 thanks per post
    1. trending_up 15,934 views
    2. thumb_up 11 thanks given
    3. group 14 followers
    1. forum 32 posts
    2. attach_file 13 attachments




 
Search this Thread

TSSuperTrend Strategy error

  #11 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


pgabriel View Post
I had the same problem ..

BTW...can anyone show me how to"round to tick size" the indicator values in TSSupertrend...so that the indicator plots and values always show tick size increments...?

try

Instrument.MasterInstrument.Round2TickSize(Close[0]);

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #12 (permalink)
 
john2000's Avatar
 john2000 
Chicago, IL
 
Experience: Intermediate
Platform: Ninjatrader, TOS
Broker: Amp Futures/CQG/IB
Trading: ES, ZB, ZN, Forex
Posts: 162 since Jan 2010
Thanks Given: 244
Thanks Received: 59

Thanks azzzz - I will give it another go.

John

Reply With Quote
  #13 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184


OK >.. still talking about TSST strategies ... I started to play with the version that was posted by LostTrader, and my ideas was to enum-it to allow optimization on calculation mode, moving average period, and type of moving average to use. I did find some examples on the NT forum, but the final solution eludes me for some reason.

The period I have ok ... but trying to get the mode and matype gets me as far as having the dropdowns in the strategy dialogue, but there is no change in the screen chart ... I am fairly sure modifying the lines around #80 in the attached will fix ... but ... on how to have it without errors in compiles ...

I added comments to help out anyone that can have a look ... NT7b19 compiled but not exported ... I use TSST 2.3

TIA!
Jon

PART TWO: progress made but not to the finish line yet

I have a 'simple' version of TS SuperTrend in a very bare bones type of strategy, built on the framework of the MACD Crossover strategy posted in the NT forums... HUGE thanks to Art Runelis for the TSST and to NT_Josh for the framework https://ninjatrader.com/support/f...catid=5&id=393 ...
and I also have a 'not simple' version that I cannot resolve these errors (each time I try it gets MUCH worse) when I try to use enums instead of hard code of some of the variables/options available in the TSST .. I am using the enums because I want to be able to optimize extensively and there are just a lot of possibility .. let the machine do the work

These are the errors are with compiler code and line#s for those that can help me out:

Invalid token '{' in class, struct, or interface member declaration, CS1519 154
Namespace does not directly contain members such as fields or methods, CS0116 155
Type or namespace definition, or end-of-file expected, CS1022 176
Namespace member declaration expected. 153
Namespace member declaration expected 175

The strategy without the enums compiles and runs in NT7b19, not optimized, only raw version .. with the enums it does not compile. Only posting the .cs as all else you need you should have already TSST v2.3 and the rest is in the NT7.

Please post here if you can make the enum version work.

Thanks to all!
Jon

Attached Files
Elite Membership required to download: TSST_v02.cs
Reply With Quote
  #14 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184


cory View Post
try

Instrument.MasterInstrument.Round2TickSize(Close[0]);

Cory,

Does that round up or round down ?

Jon

Reply With Quote
  #15 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

Seems I can edit a message but not add more files ... here are the .cs I am working with if there are guru's here that can fix I will be immensely greatful!

Jon

update: now in this thread

Attached Files
Elite Membership required to download: MACDCrossOver_w_TSSTenum.cs
Elite Membership required to download: MACDCrossOver_w_TSST.cs
Reply With Quote
  #16 (permalink)
 
john2000's Avatar
 john2000 
Chicago, IL
 
Experience: Intermediate
Platform: Ninjatrader, TOS
Broker: Amp Futures/CQG/IB
Trading: ES, ZB, ZN, Forex
Posts: 162 since Jan 2010
Thanks Given: 244
Thanks Received: 59


tarantino View Post
I have a sample SuperTrend strategy which compiles fine.

Tarantino,

Thanks for TSSuperTrendstrategySample.zip, but I still have the following errors when I try to compile! It all seems to be internal to the strategy . . .

John

Attached Thumbnails
Click image for larger version

Name:	2010-09-21_0549SupertrendError.png
Views:	271
Size:	142.6 KB
ID:	20477  
Reply With Quote
  #17 (permalink)
tarantino
Willowbrook, IL
 
Posts: 32 since Sep 2010
Thanks Given: 71
Thanks Received: 39


john2000 View Post
Tarantino,

Thanks for TSSuperTrendstrategySample.zip, but I still have the following errors when I try to compile! It all seems to be internal to the strategy . . .

John

Are you able to import it?

Reply With Quote
  #18 (permalink)
tarantino
Willowbrook, IL
 
Posts: 32 since Sep 2010
Thanks Given: 71
Thanks Received: 39

Moderators, please remove the attachment from post #16. The code includes VendorLicense call method which I forgot to remove. It confuses users and I can not edit the post (Why? It is my post...)

Thanks.

Reply With Quote
  #19 (permalink)
 bill897 
U.S.A.
 
Experience: Advanced
Platform: NinjaTrader
Posts: 19 since May 2010
Thanks Given: 5
Thanks Received: 11

Ok,

I tested the suggested TSSuperTrend Test and this is some of my code that works as follows:

// Condition set 1
if (Close[0] > Close[1] &&
TSSuperTrend(
14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[0] > TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[1])
{
double arrowpositionup = TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[0] - 1*TickSize;
DrawArrowUp(
"My up arrow" + CurrentBar, false, 0, arrowpositionup, Color.Lime); // I used arrows but you use your own commands // can use "Low[0]-3* TickSize" for position instead
}
// Condition set 2
if (Close[0] < Close[1] &&
TSSuperTrend(
14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[0] < TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[1])
{
double arrowpositiondn = TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[0] + 1*TickSize;
DrawArrowDown(
"My down arrow" + CurrentBar, false, 0, arrowpositiondn, Color.Red);
}

Attached Thumbnails
Click image for larger version

Name:	bg_Main.jpg
Views:	206
Size:	540.1 KB
ID:	20568  
Reply With Quote
  #20 (permalink)
 Zoethecus 
United States of America
 
Experience: Advanced
Platform: NT
Posts: 1,145 since Aug 2009



bill897 View Post
Ok,

I tested the suggested TSSuperTrend Test and this is some of my code that works as follows:

// Condition set 1
if (Close[0] > Close[1] &&
TSSuperTrend(
14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[0] > TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[1])
{
double arrowpositionup = TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).UpTrend[0] - 1*TickSize;
DrawArrowUp(
"My up arrow" + CurrentBar, false, 0, arrowpositionup, Color.Lime); // I used arrows but you use your own commands // can use "Low[0]-3* TickSize" for position instead
}
// Condition set 2
if (Close[0] < Close[1] &&
TSSuperTrend(
14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[0] < TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[1])
{
double arrowpositiondn = TSSuperTrend(14, MovingAverageType.SMA, 2.618, 14, SuperTrendMode.ATR).DownTrend[0] + 1*TickSize;
DrawArrowDown(
"My down arrow" + CurrentBar, false, 0, arrowpositiondn, Color.Red);
}

So, what are you suggesting we do with this?

Reply With Quote




Last Updated on October 7, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts