Need help in modifying stochastic for price forward projection - Sierra Chart Programming | futures io social day trading
futures io futures trading

Need help in modifying stochastic for price forward projection
Updated: Views / Replies:378 / 1
Created: by sw88 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

Thread Tools Search this Thread

Need help in modifying stochastic for price forward projection

  #1 (permalink)
Elite Member
New Haven, CT/USA
Futures Experience: Beginner
Platform: MT4, thinkorswim
Favorite Futures: stocks
Posts: 34 since Jul 2015
Thanks: 5 given, 3 received

Need help in modifying stochastic for price forward projection

I want to add one dummy/future price one bar forward to the current bar. For example, if current bar with index 0 with H, L, open, last/close price, last bar with index [-1] with H, L, open, close price; then I want to create a dummy/future bar with index of 1, and assign H=L=open=last price of the current bar (index 0).

When I call stochastic indicator, I'd like the price of the dummy/future bar be used to calculate the value for the next bar based on the assumptive price of H=L=open=last price. I am not sure how to modify the existing source code, as it seems calling a systemic array of price history. Can someone help? appreciate very much!

Here is the source code for the slow stochastics.

SCSFExport scsf_SlowStochastic(SCStudyInterfaceRef sc)
SCSubgraphRef SlowK = sc.Subgraph[0];
SCSubgraphRef SlowD = sc.Subgraph[1];
SCSubgraphRef Line1 = sc.Subgraph[2];
SCSubgraphRef Line2 = sc.Subgraph[3];
SCSubgraphRef Temp4 = sc.Subgraph[4];

SCInputRef FastKLength = sc.Input[2];
SCInputRef FastDLength = sc.Input[3];
SCInputRef SlowDLength = sc.Input[4];
SCInputRef Line1Value = sc.Input[5];
SCInputRef Line2Value = sc.Input[6];
SCInputRef MovAvgType = sc.Input[7];
SCInputRef InputDataHigh = sc.Input[8];
SCInputRef InputDataLow = sc.Input[9];
SCInputRef InputDataLast = sc.Input[10];
SCInputRef UpdateFlag = sc.Input[11];

if ( sc.SetDefaults )
sc.GraphName = "Stochastic - Slow";

sc.ValueFormat = 2;

SlowK.Name = "Slow %K";
SlowK.PrimaryColor = RGB(0,255,0);
SlowK.DrawZeros = true;

SlowD.Name = "Slow %D";
SlowD.PrimaryColor = RGB(255,0,255);
SlowD.DrawZeros = true;

Line1.Name = "Line1";
Line1.DrawStyle = DRAWSTYLE_LINE;
Line1.PrimaryColor = RGB(255,255,0);
Line1.DrawZeros = true;

Line2.Name = "Line2";
Line2.DrawStyle = DRAWSTYLE_LINE;
Line2.PrimaryColor = RGB(255,127,0);
Line2.DrawZeros = true;

FastKLength.Name = "Fast %K Length";

FastDLength.Name = "Fast %D Length (Slow %K)";

SlowDLength.Name = "Slow %D Length";

Line1Value.Name = "Line1 Value";

Line2Value.Name = "Line2 Value";

MovAvgType.Name = "Moving Average Type";

InputDataHigh.Name = "Input Data for High";

InputDataLow.Name = "Input Data for Low";

InputDataLast.Name = "Input Data for Last";

UpdateFlag.SetInt(1); //update flag

sc.AutoLoop = true;

sc.DataStartIndex = FastKLength.GetInt() + FastDLength.GetInt() + SlowDLength.GetInt();

Temp4, // Data member is Fast %K

SlowK[sc.Index] = Temp4.Arrays[0][sc.Index];
SlowD[sc.Index] = Temp4.Arrays[1][sc.Index];

Line1[sc.Index] = Line1Value.GetFloat();
Line2[sc.Index] = Line2Value.GetFloat();



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.


futures io > > > > > Need help in modifying stochastic for price forward projection

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to scroll chart forward past price action? north88 IB Trader Workstation 1 April 19th, 2015 04:55 PM
Indicator to plot a line x bars forward above and below the closing price skiguy NinjaTrader Programming 1 November 17th, 2013 05:46 AM
Auto ABC Projection indi jtrade NinjaTrader Programming 14 October 14th, 2013 08:59 AM
CPO (Cycle Projection Oscillator) Leo123 The Elite Circle 3 January 17th, 2012 03:36 PM
Hi all, has anybody these indicators: Widner Projection Band bstrader NinjaTrader 2 May 21st, 2010 11:52 PM

All times are GMT -4. The time now is 09:33 PM.

Copyright © 2018 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
Page generated 2018-05-20 in 0.08 seconds with 19 queries on phoenix via your IP