Shifting Values within a Variable - TradeStation | futures trading

Go Back

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

Shifting Values within a Variable
Started:September 20th, 2015 (01:42 PM) by trader0311 Views / Replies:261 / 0
Last Reply:September 20th, 2015 (01:42 PM) Attachments:0

Welcome to

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

Thread Tools Search this Thread

Shifting Values within a Variable

Old September 20th, 2015, 01:42 PM   #1 (permalink)
Trading Apprentice
Wheeling, WV USA
Futures Experience: Advanced
Platform: TS, MC
Favorite Futures: ES
Posts: 1 since Feb 2015
Thanks: 0 given, 0 received

Shifting Values within a Variable


I have a variable that is conditional meaning that sometimes values are calculated for the variable and sometimes they are not depending on if my condition is true. When the condition is not true generally the last value that the variable produced is used over and over until the condition is true and another value is added (or I can add in a zero). To illustrate please see the string of numbers below:

1, 2, 3, 4, 5, 5, 5, 5, 5, 6, 7, 8

As you can see in this string the number 5 is repeated. The problem I am facing is that I want to apply an analysis technique, like a moving average, to this string of numbers contained in a variable. The consecutive 5's will screw up the analysis technique you apply because of this "flat spot" (ie the consecutive 5's).

My question related as to how I eliminate these redundant numbers or flat spots so I can properly apply different analysis techniques or functions to the variable. When done properly the string of numbers would read 1,2,3,4,5,6,7,8.

Ideally I would like to do this within a variable since arrays can be difficult to apply analysis techniques to. I had the idea of shifting all the values in the variable to the right by one bar when my condition was not true. If that was possible, the shift in the numbers would eliminate this gap of redundant numbers in my string. Would anyone have an idea regarding how I can accomplish this shift in the variable values using easylanguage? Any insight would be greatly appreciated. This has had me stumped for the longest time.

Reply With Quote

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > Shifting Values within a Variable

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static Variable from Pre-defined variable jrobinson3002 MetaQuotes MetaTrader MQL Programming 1 April 15th, 2015 09:15 PM
Shifting an indicator plot? jordis NinjaTrader Programming 6 January 30th, 2013 08:34 PM
Chart Values/Tool Values Window is missing Big Mike Sierra Chart 17 August 24th, 2012 07:05 PM
Global Policy Shifting From Austerity Toward Growth Quick Summary News and Current Events 0 April 29th, 2012 05:30 PM
Translating EMA-values to ZN-values or visaversa max-td NinjaTrader Programming 17 June 22nd, 2009 03:42 PM

All times are GMT -4. The time now is 04:32 PM.

Copyright © 2016 by 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-10-21 in 0.07 seconds with 21 queries on phoenix via your IP