Need help to see what's wrong with my code - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Need help to see what's wrong with my code
Updated: Views / Replies:845 / 5
Created: by kingfish88 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
 

Need help to see what's wrong with my code

  #1 (permalink)
Elite Member
Las Vegas
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: ES
 
Posts: 14 since Jun 2009
Thanks: 65 given, 2 received

Need help to see what's wrong with my code

Sorry I'm new to Thinkscript.

I'm try to plot a arrow on every 4 consecutive down day (close to close), and 5 consecutive up day.

===
Plot Down4Day = close < close[-1] and close[-1] < close[-2]
and close[-2] < close[-3]
and close[-3] < close[-4]
;

Down4Day.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);

Plot Up5Day = close > close[-1] and close[-1] > close[-2]
and close[-2] > close[-3]
and close[-3] > close[-4]
and close[-4] > close[-5]
;

Up5Day.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_Down);

====

but after I apply this code to a chart, the arrows are no where near what it should be. Anything would be helpful!!!

Thanks in advance!!!

Wes

Reply With Quote
 
  #2 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

The period number without the negative looks back:

 
Code
Plot Down4Day = close < close[1] and close[1] < close[2] and close[2] < close[3] and close[3] < close[4];
Down4Day.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_UP);
Down4Day.SetDefaultColor(Color.GREEN);



Plot Up5Day = close > close[1] and close[1] > close[2] and close[2] > close[3] and close[3] > close[4] and close[4] > close[5];
Up5Day.SetPaintingStrategy(PaintingStrategy.Boolean_ARROW_Down);
Up5Day.SetDefaultColor(Color.Red);

Reply With Quote
The following 2 users say Thank You to rmejia for this post:
 
  #3 (permalink)
Elite Member
Las Vegas
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: ES
 
Posts: 14 since Jun 2009
Thanks: 65 given, 2 received


Cool. Thx!

Reply With Quote
 
  #4 (permalink)
Elite Member
Trubchevsk
 
Futures Experience: Beginner
Platform: tos
Favorite Futures: stocks
 
Posts: 48 since May 2011
Thanks: 34 given, 64 received

Consecutive equal conditions can be optimized by sum function for example the two following conditions returns equal results::

1. sum(close>close[1],3) == 3

2. close>close[1] and close[1]>close[2] and close[2]>close[3]

Reply With Quote
The following 3 users say Thank You to growex for this post:
 
  #5 (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,

The "sum" instructions is shorter (in number of characters) but I think that it is slower (in execution time).

It requires three evaluations of the condition whereas the "and" is supposed to return FALSE if the first condition is FALSE, without evaluating the two others.

Nicolas

Reply With Quote
 
  #6 (permalink)
Elite Member
Trubchevsk
 
Futures Experience: Beginner
Platform: tos
Favorite Futures: stocks
 
Posts: 48 since May 2011
Thanks: 34 given, 64 received

Yes, Nicolas, it sure is. This is just an example of using boolean return in mathematical operations
I've seen alot of studies with statements like:
def c = if a>b then 1 else 0;
actually there is no need to assign 1 or 0 such way, the optimized equation would be simply
def c = a>b;

Reply With Quote
The following 2 users say Thank You to growex for this post:

Reply



futures io > > > > > Need help to see what's wrong with my code

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
Wrong Target Fill steveh3167 NinjaTrader 5 March 26th, 2013 12:21 AM
What Everybody Is Getting Wrong About The New President Of France kbit News and Current Events 0 May 7th, 2012 09:01 AM
Wrong gift kbit Jokes 1 February 15th, 2012 06:26 PM
Odds Are, It's Wrong kbit Off-Topic 24 November 18th, 2011 04:28 PM
What's wrong with my SUM logic? gordo NinjaTrader Programming 1 July 18th, 2010 09:04 PM


All times are GMT -4. The time now is 04:19 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-17 in 0.10 seconds with 19 queries on phoenix via your IP 54.227.51.103