Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
hi, i need to create two average in tradestation of open - low of last 4 bars with up close and the second of high - open with down close.
somebody can help me ?
Can you help answer these questions from other members on NexusFi?
I must admit that I am not sure what exactly you are trying to compute. Maybe you can elaborate a bit on what exactly you want to compute, maybe even with a an example?
When you say "open - low of last 4 bars with up close", how does the up close go into the formula?
thank you for the clarification. I don't think you can use the built in average function simply because you can't use every bar, but you'll have to skip bars in between.
The easiest approach will likely be to use an array and store the last 4 bars (or however many you want it to store).
With that you can compute your own average over all values within the array.
You will need a counter that tracks at which position you are currently at within the array and when you have stored 4 values, you will have to start back over and overwrite the first stored value with the new value etc..
This way you'll ensure to only hold the recent 4 values.
This is not too hard to accomplish, but it will require a little bit of coding.
I'll gladly steer you in the right direction or help you with your code if you post it. If you follow the plan I outlined, you should be able to accomplish what you have in mind.
Not knowing your programming skill level, the Easylanguage Essentials PDF might be a good start.