futures io



Find H and L between last 3 bars every 3 bars


Discussion in EasyLanguage Programming

Updated
    1. trending_up 631 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Find H and L between last 3 bars every 3 bars

(login for full post details)
  #1 (permalink)
Carlera
Colombia
 
 
Posts: 11 since Mar 2021
Thanks: 1 given, 1 received

Hello everyone,

I need your help with a code that finds the HIGH and LOW between the last 3 bars ( red boxes ) and the next 3 bars without taking into account the previous 3 as shown in the figure. To perform the following calculation.

S = (4*X + 3*X[1] + 2*X[2] + X[3])

I have tried but I have not found a solution. Thank you for your time.


Reply With Quote

Can you help answer these questions
from other members on futures io?
DefineDLLFunc C++ Example
EasyLanguage Programming
Import failed: the ninjasceipt archive file may contain …
NinjaTrader
I wonder and I ask you…
Psychology and Money Management
ninja trdaer order blocks, orice action ict
NinjaTrader
Trading instruments in different base currencies - how t …
Brokers
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
28 thanks
New NinjaTrader
18 thanks
futures io site changelog and issues/problem reporting
16 thanks
Unsubscribe from Threads
14 thanks
Not enough skin in the game?
10 thanks
 
(login for full post details)
  #2 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,503 since Jul 2012
Thanks: 1,838 given, 7,059 received

Not sure if this is what you are looking for... (not checked)

var:X(0),X1(0),X2(0),X3(0),X4(0);

X=(maxlist(high,high[1])+minlist(low,low[1]))/2.

X1=(maxlist(high[2],high[3],high[4])+minlist(low[2],low[3],low[4]))/2.

X2=(maxlist(high[5],high[6],high[7])+minlist(low[5],low[6],low[7]))/2.

X3=(maxlist(high[8],high[9],high[10])+minlist(low[8],low[9],low[10]))/2.

X4=(maxlist(high[11],high[12],high[13])+minlist(low[11],low[12],low[13]))/2.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #3 (permalink)
Carlera
Colombia
 
 
Posts: 11 since Mar 2021
Thanks: 1 given, 1 received


Kevin thanks for your time, maybe my explanation was no the better,


Attached new imagen explaining better,
the first imagen (red boxes) was hand draw.

The idea is to find the Highest and Lowest in the 3x bars interval formed, like you can see in the pic.
calculate and storage ‘X’ to get data .....X, X[1], X[2]........ so on.
You can see part of code.

Where: X ‘Variable to store, ” it can be another letter , X= (H+L)/2
H= Highest of 3 bars interval
L= Lowest of 3 bars interval

// -----------------------------------------------
Vars: X(0), S(0), D(0);

X= (H+L)/0.5;

If CurrentBar > 5 Then Begin

S = (4*X + 3*X[1] + 2*X[2] + X[3]) / 10; // Calculate S with X[1],.......X[3]
D = (.0962*S + .5769*S[2] - .5769*S[4]- .0962*S[6]); // Calculate D with S[1],.......S[6]

{……….. part of the code.
.........
}

End;

//-----------------------------------------


Regards,
Carlos


I
kevinkdog View Post
Not sure if this is what you are looking for... (not checked)

var:X(0),X1(0),X2(0),X3(0),X4(0);

X=(maxlist(high,high[1])+minlist(low,low[1]))/2.

X1=(maxlist(high[2],high[3],high[4])+minlist(low[2],low[3],low[4]))/2.

X2=(maxlist(high[5],high[6],high[7])+minlist(low[5],low[6],low[7]))/2.

X3=(maxlist(high[8],high[9],high[10])+minlist(low[8],low[9],low[10]))/2.

X4=(maxlist(high[11],high[12],high[13])+minlist(low[11],low[12],low[13]))/2.


Reply With Quote
 
(login for full post details)
  #4 (permalink)
 kevinkdog   is a Vendor
 
 
Posts: 3,503 since Jul 2012
Thanks: 1,838 given, 7,059 received

Sorry, I am unclear what you want. Maybe someone else will understand.

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #5 (permalink)
Carlera
Colombia
 
 
Posts: 11 since Mar 2021
Thanks: 1 given, 1 received

Hi Kevin,

For example, if I have a 5 minutes chart, 3 bars in the that interval are 1 bar in a 15 min chart. Then H and L in 15 min chart, is the same the H and L en 5 min chat ( 3 bars x 5 min).

I want to find the H and L for 15 min bar, but in the 5 min chart. for that the 3 bars interval.

I hope you can help me, please.
thank you,


kevinkdog View Post
Sorry, I am unclear what you want. Maybe someone else will understand.


Reply With Quote
 
(login for full post details)
  #6 (permalink)
alan tsai
Taipei ,Taiwan
 
 
Posts: 2 since Apr 2021
Thanks: 42 given, 0 received


Carlera View Post
Kevin thanks for your time, maybe my explanation was no the better,


Attached new imagen explaining better,
the first imagen (red boxes) was hand draw.

The idea is to find the Highest and Lowest in the 3x bars interval formed, like you can see in the pic.
calculate and storage ‘X’ to get data .....X, X[1], X[2]........ so on.
You can see part of code.

Where: X ‘Variable to store, ” it can be another letter , X= (H+L)/2
H= Highest of 3 bars interval
L= Lowest of 3 bars interval

// -----------------------------------------------
Vars: X(0), S(0), D(0);

X= (H+L)/0.5;

If CurrentBar > 5 Then Begin

S = (4*X + 3*X[1] + 2*X[2] + X[3]) / 10; // Calculate S with X[1],.......X[3]
D = (.0962*S + .5769*S[2] - .5769*S[4]- .0962*S[6]); // Calculate D with S[1],.......S[6]

{……….. part of the code.
.........
}

End;

//-----------------------------------------


Regards,
Carlos


I




x=(highest(h[1],3)+lowest(L[1],3))/2
S = (4*X + 3*X[3] + 2*X[6] + X[9]) / 10

or

inputs: n(3," bars interval"),n1(1200,"total bars");
var: i(0),j(0);
array: x[400](0),s[400](0);

If CurrentBar > 5 Then Begin
for i=0 to floor(n1/n) // keep integer
x[i]=(highest(h[n*I+1],n)+lowest(L[n*i+1],n))/2;

for i=0 to floor(n1/n)
begin

for j= n+1 downTo 1
s[i]=s[i]+j*x[n+1-j];

s[i]=s[i]/((n+2)*(n+1)/2); //wma
end ;

end;
D = (.0962*S[0] + .5769*S[2] - .5769*S[4]- .0962*S[6]); // Calculate D with S[1],.......S[6]

{……….. part of the code.
.........
}

End;

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Find H and L between last 3 bars every 3 bars


Last Updated on March 19, 2023


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@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