How to code this set up ? - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


How to code this set up ?
Updated: Views / Replies:426 / 20
Created: by Ty199 Attachments:2

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

Reply
 2  
 
Thread Tools Search this Thread
 

How to code this set up ?

  #1 (permalink)
Joplin, Mo. Jasper
 
 
Posts: 12 since Sep 2019
Thanks: 2 given, 11 received

How to code this set up ?

I dont know anything about coding. I tried and just not that smart lol. But been playing with a formula that seems to work pretty good. But instead of adding it all up, is there a way to have it coded so TOS does it?
Pretty simple maybe ?
It is previous day High and Low subtracted from each other.
Then that value would be divided by 4
That would then be added on the next day open and also be subtracted from the next day open.
So there would be 2 lines, a high and a low applied to the chart.

It is figured like this.
Previous day High 58.70 Previous day Low 53.20
These are now subtracted for the difference which is 5.50
That value is divided by 4 which values at 1.375
Now 1.375 is added to the next day open price (ex. open price is 56.10 + 1.375 = 57.475 )
It is also subtracted from the open price ( ex. open price is 56.10 - 1.375 = 54.725 )
Now you have a high and a low that is calculated automatically and placed on the chart for that day of trading.
High 57.475 Low 54.725. There is no need the number to be odd as it is not rounded. (ex. 54.725 change up or down to a whole number such as 54.72)
I tried to write something up and it just dont even come close to working. Is there a way to even calculate this to be added as a study ?
All help is much welcome.

Reply With Quote
 
  #2 (permalink)
Legendary Market Wizard
Chicago Illinois USA
 
Trading Experience: Advanced
Broker/Data: IB, ToS
Favorite Futures: /ES, US Equities/Options
 
wldman's Avatar
 
Posts: 2,692 since Aug 2011
Thanks: 1,403 given, 4,738 received

Hey Man...

Like you I am not a code guy, but I persist in at least trying because the code community, especially on ToS, will respect the effort and maybe point the way.

What you are thinking about or something very similar was/is and idea that has been widely used in the past by someone whose name I'm not going to mention.

Daily Range Projections do lend themselves to the notion of a statistical model. The "data run" for which is quite simple.

Here is what I used. Even I was able to script this for Ninjatrader.

If period close < period open use: (H+L+L+C)/2 = X
If period close > period open use: (L+H+H+C)/2= X
If period close = period open use: (H+L+L+C)/2 = X

To calculate range projections for the next period..

For each of the formulas, to calc next period projected high, subtract current period L from X. To Calc next period projected low, subtract current period H from X.

So a basic model could be when price moves this direction from open some number of ticks 70% of the time it continues some distance before/without retrace.

Here is the thing. If you SHOW the attempt and the result, guys with the skill will believe you. Otherwise it just looks like you want someone else to do the work for you. When they see that you are trying they will correct your errors and give advice.

Good Luck.

-Dan

Visit my futures io Trade Journal Reply With Quote
 
  #3 (permalink)
Joplin, Mo. Jasper
 
 
Posts: 12 since Sep 2019
Thanks: 2 given, 11 received


Thank you, I will keep trying and post results. I have a hard time making the plot
<high of previous day - low of previous day = A>
<A / 4 = B>
<B + open price = C placed on chart>
<B - open price = D placed on chart>

I try to put this in and it dont recognize any values. Its like I watch all the videos that show how to code but for some reason I dont get the same or formula or anything. I would love to be able to code on TOS . I have several methods I would love to try that would would alert at a price point and trend directions , pivot points, possible buy and sell signals. I love just testing new strategies and seeing what works under normal market behavior.
Thanks for the help and I will keep plugging away at it.

Reply With Quote
 
  #4 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 254 since Dec 2018
Thanks: 367 given, 564 received

I can code this up when I get back to my computer tonight!

Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to mtzimmer1 for this post:
 
  #5 (permalink)
Joplin, Mo. Jasper
 
 
Posts: 12 since Sep 2019
Thanks: 2 given, 11 received


mtzimmer1 View Post
I can code this up when I get back to my computer tonight!

That would be awesome. But would you be able to help me understand what everything means? I dont understand where I go wrong. I try and I am putting things in wrong spaces or leaving something out.

Reply With Quote
The following user says Thank You to Ty199 for this post:
 
  #6 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 254 since Dec 2018
Thanks: 367 given, 564 received

Here is the code!

declare upper;


def y_high = high(period=aggregationperiod.day)[1];
def y_low = low(period=aggregationperiod.day)[1];

def y_range = y_high-y_low;

def d_open = open(period=aggregationPeriod.DAY);

plot upper = d_open+(.25*y_range);

plot lower = d_open-(.25*y_range);

#########

This should work nicely. I'm headed to bed now but tag me with any questions and I'm happy to respond tomorrow!

Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to mtzimmer1 for this post:
 
  #7 (permalink)
Joplin, Mo. Jasper
 
 
Posts: 12 since Sep 2019
Thanks: 2 given, 11 received


mtzimmer1 View Post
declare upper;


def y_high = high(period=aggregationperiod.day)[1];
def y_low = low(period=aggregationperiod.day)[1];

def y_range = y_high-y_low;

def d_open = open(period=aggregationPeriod.DAY);

plot upper = d_open+(.25*y_range);

plot lower = d_open-(.25*y_range);

#########

This should work nicely. I'm headed to bed now but tag me with any questions and I'm happy to respond tomorrow!

Thank you so much !! this is awesome. I need to learn this coding more. I can get close but I still need work.
But Im running this on /QM /CL /NG /PL you can see how it breaks out of the high and low lines. So cool !! I added some daily support and resistance lines to my chart and looks like it gives some great exit points of the trade. It also looks like you can do a 2 to 1 risk management. Risk $50 and look at $100 to cover. Most looks like it will go more than 2 to 1, about 4 to 1 LOL..... This is sweet, Please I need to learn more on this coding. How do you do this ??

Reply With Quote
The following user says Thank You to Ty199 for this post:
 
  #8 (permalink)
Lenox, Ma
 
Trading Experience: Beginner
Platform: TOS
Favorite Futures: US Equities
 
Posts: 254 since Dec 2018
Thanks: 367 given, 564 received

Hey I'm glad it is working for you!

Coding is one of those things you just need to look at and troubleshoot over and over again until it sinks in.

I would be more than happy to work with you on learning the basics of coding. You come up with ideas and I'll code them up and try to explain why each function does what it does. Win for both of us!

Cheers my friend,
Zimmer

Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to mtzimmer1 for this post:
 
  #9 (permalink)
Joplin, Mo. Jasper
 
 
Posts: 12 since Sep 2019
Thanks: 2 given, 11 received


mtzimmer1 View Post
Hey I'm glad it is working for you!

Coding is one of those things you just need to look at and troubleshoot over and over again until it sinks in.

I would be more than happy to work with you on learning the basics of coding. You come up with ideas and I'll code them up and try to explain why each function does what it does. Win for both of us!

Cheers my friend,
Zimmer

Sounds Great and I appreciate it so much ! I have one that involves a few indicators for US bonds. It does ok and made a few good trades from it. But Im going to run this on Paper for a few days and see the profit / loss ratio is and how many trades that are positive and negative. Im trying to come up with a good buy area after it shows a break out and a stop loss and target profit. I will make a few rules on trading it and sticking by it and post the results back here. I appreciate your help so much and will be sending you a PM here soon on the coding. Thanks !!!

Reply With Quote
The following user says Thank You to Ty199 for this post:
 
  #10 (permalink)
Market Wizard
Calgary, Alberta
 
Trading Experience: Advanced
Platform: NinjaTrader 8
Broker/Data: Kinetick
Favorite Futures: ES
 
JonnyBoy's Avatar
 
Posts: 1,038 since Apr 2012
Thanks: 394 given, 2,098 received



mtzimmer1 View Post
declare upper;


def y_high = high(period=aggregationperiod.day)[1];
def y_low = low(period=aggregationperiod.day)[1];

def y_range = y_high-y_low;

def d_open = open(period=aggregationPeriod.DAY);

plot upper = d_open+(.25*y_range);

plot lower = d_open-(.25*y_range);

#########

This should work nicely. I'm headed to bed now but tag me with any questions and I'm happy to respond tomorrow!

I don't use T.O.S but when guys have completed development of this, consider uploading to the download section. I like what you doing here, and it could help out others.

--------------------------------------------------------
- Trade what you see. Invest in what you believe -
--------------------------------------------------------
Visit my futures io Trade Journal Reply With Quote

Reply



futures io > > > > > How to code this set up ?

« help adding arrows | - »
Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

September
 

Webinar: The Best Entries and Exits in trading & in life w/Agustin Lebron

Elite only
 

Webinar: NinjaTrader 8 Newest Features Release Sneak Peek

Sep 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strategy help: Trying to have entry, set stop loss, and set target on the next bar turboscottomatic EasyLanguage Programming 2 January 22nd, 2015 06:46 AM
NT - How to set ATM Quantity via NT script code Adfra The Elite Circle 1 November 11th, 2013 03:00 AM
need a coder to code new NT7 indi from existing MT4 indi - I have source code traderdp Hire a Consultant or Programmer 0 January 31st, 2013 08:21 PM
Code question: Dataseries.Set() with 2 parameters? fernlicht The Elite Circle 3 January 31st, 2013 07:34 AM
Better Momentum's "code #" I Lost...r all code #'s same ? xm4730 ?? Billbb Platforms and Indicators 2 January 26th, 2012 06:15 PM


All times are GMT -4. The time now is 06:17 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, 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