NexusFi: Find Your Edge


Home Menu

 





average


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,796 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
capper
bergamo
 
Posts: 7 since Apr 2016
Thanks Given: 0
Thanks Received: 2

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 ?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CPI Eve: Fed Hike Odds Hold at 52% for the First Time, I …
Prediction Markets & Event Contracts
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Trump Media to sell instant access to market-moving soci …
Traders Hideout
Trump Truth Social Fires Hormuz From 10% to 59% -- Arsen …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


capper,

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?

Regards,

ABCTG


Follow me on X Reply With Quote
  #4 (permalink)
capper
bergamo
 
Posts: 7 since Apr 2016
Thanks Given: 0
Thanks Received: 2


ABCTG View Post
capper,

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?


Regards,

ABCTG



Up close is close > open and I don't know how to insert this condition in the average


Reply With Quote
Thanked by:
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

capper,

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.

Regards,

ABCTG



capper View Post
Up close is close > open and I don't know how to insert this condition in the average


Follow me on X Reply With Quote
  #6 (permalink)
capper
bergamo
 
Posts: 7 since Apr 2016
Thanks Given: 0
Thanks Received: 2


ABCTG View Post
capper,

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.

Regards,

ABCTG

Ok thanks, but can you help me with some code or do you know if there is a guide for this ?


Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

capper,

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.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on April 15, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts