stochastic now versus 1 bar ago
futures io futures trading

stochastic now versus 1 bar ago
Updated: Views / Replies:283 / 3
Created: by westofpluto 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

stochastic now versus 1 bar ago

Posts: 4 since Jan 2019
Thanks: 0 given, 0 received

stochastic now versus 1 bar ago

I'm new to easy language and I'm a bit confused about the syntax when comparing the value of the stochastic now versus one bar ago.

The stochastic is computed as follows:

ok = Stochastic(High, Low, Close, 14, 3, 3, 1, oFastK, oFastD, oSlowK, oSlowD);

And the "value" I am looking for is oSlowK - oSlowD. So this is the value at the current bar. How do I get the value at the previous bar? One possibility is this:

ok2 = Stochastic(High[1], Low[1], Close[1], 14, 3, 3, 1, oFastK1, oFastD1, oSlowK1, oSlowD1);
value1 = oSlowK1 - oSlowD1

But is it also (instead) possible to just use this:

value1 = oSlowK[1] = oSowD[1];

What is the correct syntax?

Can you help answer these questions
from other members on futures io?
Price Levels With Start And End Times [ThinkOrSwim]
(20 days ago)
Does Tradestation on windows server? [TradeStation]
(21 days ago)
Looking for help identifying an indicator [NinjaTrader]
adding labels that always stay on the left on horizonal ... [ThinkOrSwim]
(2 days ago)
vwap strategy [TradeStation]
(15 days ago)

Best Threads (Most Thanked)
in the last 7 days on futures io
ES futures Spoo-nalysis SP500/SPX
(309 thanks)
Recession? Depression? Bailout!
(258 thanks)
Coronavirus COVID-19
(226 thanks)
Finally Turning the Corner, tha "its 80% Psychology ...
(81 thanks)
Understanding Footprint Charts / Number bars
(80 thanks)
Huntsville, AL
Trading Experience: Intermediate
Platform: TradeStation
Broker/Data: Tradestation
Favorite Futures: Index Futures
Posts: 10 since Jun 2014
Thanks: 1 given, 0 received

westofpluto View Post
ok2 = Stochastic(High[1], Low[1], Close[1], 14, 3, 3, 1, oFastK1, oFastD1, oSlowK1, oSlowD1);
value1 = oSlowK1 - oSlowD1

westofpluto View Post
value1 = oSlowK[1] = oSowD[1];

I believe the two code snippets should provide exactly the same answer. As a test, put both sets of code in the same indicator and plot them. I would expect they would be the same line.

Hamburg Germany
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
Posts: 2,163 since Apr 2013
Thanks: 384 given, 1,396 received


you can reference previous bar's values for variables (just like you can do for some reserved words) using [x], where x is the number of bars back starting from the current bar, which is 0.
In your case both ways will work, but since you likely call the stochastic already within your code getting the previous bars values using oSlowK[1] and oSowD[1] will be more efficient.

If you haven't done so already, I would suggest checking out the free EasyLanguage Essentials PDF that you can download on the Tradestation website. It will bring you up to speed in terms of the basics of EasyLanguage.



Follow me on Twitter Visit my Facebook


futures io Trading Community Platforms and Indicators TradeStation EasyLanguage Programming > stochastic now versus 1 bar ago
Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Highest bar between 20 and 40 bars ago DavidBodhi NinjaTrader Programming 5 August 25th, 2017 02:35 PM
How to step forward bar by bar (F12) with full bar not half bar? mercyman MetaTrader 1 October 23rd, 2012 04:49 PM
Stochastic of a Stochastic adrenalinz MultiCharts 5 July 20th, 2012 08:04 AM
HSBC Profit 'Well Ahead' of Year Ago, Bad Debts Fall Quick Summary News and Current Events 0 November 5th, 2010 05:40 AM
x sessions ago SARdynamite NinjaTrader Programming 15 July 13th, 2010 08:20 PM

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

Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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