Coding Your Own Stochastic Indicator - EasyLanguage Programming | futures.io
futures.io futures trading
 

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming


Coding Your Own Stochastic Indicator
Started:October 21st, 2016 (12:05 PM) by djvie11 Views / Replies:101 / 4
Last Reply:October 21st, 2016 (12:45 PM) Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike
     

Reply
 
Thread Tools Search this Thread

Coding Your Own Stochastic Indicator

Old October 21st, 2016, 12:05 PM   #1 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 27 since Jul 2013
Thanks: 14 given, 1 received

Coding Your Own Stochastic Indicator

Hi Guys!

So I've been trying to code my own version of a stochastic crossover so I have more control over it. Below is my code but it's not working quite like the one that's already built into the system.

I'm trying to do this so I can get a signal on a 2 data chart (Stochastic is meant for Data2), but not having to wait until the close of Data2 to actually get the stochastic signal.

Please let me know if you think I'm missing something on the below code. Thanks!

 
Code
Inputs:
PercentK_data2 ((C of data2 - Lowest (L of data2,14)) / (Highest (H of data2,14)) - (Lowest (L of data2,14)) / 100 ) ;

Variables:
PercentD_data2 (Average (bkPercentK_data2, 3)) ;

Condition1 = bkPercentK_data2 > bkPercentD_data2 ;
Condition2 = bkPercentK_data2 < bkPercentD_data2 ;

Reply With Quote
     

Old October 21st, 2016, 12:05 PM   #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.

     

Old October 21st, 2016, 12:26 PM   #3 (permalink)
 Vendor: abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,151 since Apr 2013
Thanks: 191 given, 648 received


djvie11,

what exactly does your code do and more important, what do you want your code to do instead?

Did you print or plot the input and variable to see if they hold the values that you expect them to have?

Regards,

ABCTG


Last edited by ABCTG; October 21st, 2016 at 12:33 PM.
Reply With Quote
     

Old October 21st, 2016, 12:38 PM   #4 (permalink)
Trading Apprentice
Chicago, IL
 
Futures Experience: Advanced
Platform: Tradestation + Multicharts
Favorite Futures: Forex, Futures
 
Posts: 27 since Jul 2013
Thanks: 14 given, 1 received


ABCTG View Post
djvie11,

what exactly does your code do and more important, what do you want your code to do instead?

Regards,

ABCTG

The calculations are a little screwy, and I'd also like to make the 14-period input a variable. However, when trying to make it an input, I get a "Wrong Expression" error after trying to compile the code.
(PercentK_data2 ((C of data2 - Lowest (L of data2,14)) )

Ex:
 
Code
Inputs:
14PeriodVar (1),
PercentK_data2 ((C of data2 - Lowest (L of data2,14PeriodVar)) / (Highest (H of data2,14PeriodVar)) - (Lowest (L of data2,14PeriodVar)) / 100 ) ;

Reply With Quote
     

Old October 21st, 2016, 12:45 PM   #5 (permalink)
 Vendor: abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,151 since Apr 2013
Thanks: 191 given, 648 received

Futures Edge on FIO

Are you a NinjaTrader user?

 
djvie11,

I would suggest to start with making the code easier to read and to maintain i.e. not trying to put the whole code computations into one input and variable, but instead by using several variables that you compute within your code (and not on declaration). The issue you might run into otherwise is that the variable keeps a static value, although you think it's dynamic.

A good way to verify this is by printing or plotting the actual value for input and variable in it's current form.

Regards,

ABCTG

Reply With Quote
     
The following user says Thank You to ABCTG for this post:
     

Reply



futures.io > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > Coding Your Own Stochastic Indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Trading Technologies: ADL hands-on

Dec 13

Normal webinar schedule resumes after the holidays

January

Ernie Chan: Risk Management

Elite only

Dedicated Trading Servers: Advantages/Disadvantages w/sam028

Elite only

An Afternoon with FIO member Massive I

Elite only

Leo Murphy: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other]       Indicator Parameter? Stochastic Momentum Index EdenR Platforms and Indicators 4 November 21st, 2016 03:55 PM
TOS EFV Stochastic Indicator eensor ThinkOrSwim 0 June 15th, 2016 01:02 PM
VSR Indicator (Volume/Stochastic/Reversal Bars) HJay The Elite Circle 22 May 11th, 2016 12:25 PM
Stochastic Momentum Index Indicator sunny135 NinjaTrader 1 January 8th, 2014 11:54 AM
Stochastic %K Indicator timefreedom The Elite Circle 4 September 16th, 2010 05:12 PM


All times are GMT -4. The time now is 06:45 AM.

Copyright © 2016 by 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 2016-12-10 in 0.08 seconds with 19 queries on phoenix via your IP 54.166.37.177