NexusFi: Find Your Edge


Home Menu

 





Highest high for specific bars - easylanguage code suggestion


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ABCTG with 11 posts (2 thanks)
    2. looks_two cactus1973 with 10 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 edgefirst with 1 posts (1 thanks)
    1. trending_up 8,209 views
    2. thumb_up 5 thanks given
    3. group 6 followers
    1. forum 24 posts
    2. attach_file 3 attachments




 
Search this Thread

Highest high for specific bars - easylanguage code suggestion

  #1 (permalink)
cactus1973
Canicattė Italy
 
Posts: 15 since Nov 2018
Thanks Given: 0
Thanks Received: 0

Hello, everyone,
I am not very experienced with easylanguage, I have difficulty in coding the command to find highest (high, 5) only among the previous bars that have a minimum lower than the level x.

I hope I have explained well, I also enclose an image for more clarity. The result should return the maximum of bar A.

Anyone have any suggestions?

Thank you in advance

Gioak

Attached Thumbnails
Click image for larger version

Name:	B.png
Views:	343
Size:	28.2 KB
ID:	262400  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


Hi Gioak,

I would suggest looking into the "for loop" as you will have to cycle through the previous bars and only include those that are lower than X in your tracking of the highest high.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #4 (permalink)
cactus1973
Canicattė Italy
 
Posts: 15 since Nov 2018
Thanks Given: 0
Thanks Received: 0

Yes, but unfortunately I don't know how to select only the bars with the minimum lower than x.

Gioak

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Hi Gioak,

post the code you have for the loop and I am sure someone can point you in the right direction.

You might want to take a look at the free EasyLanguage Essentials PDF that you can find on the net. It will explain the basis and cover loops, too.

Regards,

ABCTG


cactus1973 View Post
Yes, but unfortunately I don't know how to select only the bars with the minimum lower than x.

Gioak


Follow me on Twitter Reply With Quote
  #6 (permalink)
cactus1973
Canicattė Italy
 
Posts: 15 since Nov 2018
Thanks Given: 0
Thanks Received: 0

HI ABCTG,

Thanks for your suggestions, I'll try to examine the free EasyLanguage Essentials PDF.

The code should be something like this:

Var: x(0), y(0);
For x = 1 to 5 and for y = 5 downto 1 begin

IF L [x] < x and H [x] = highest(high,y) then A = H [x] ;
end;

The problem is that I can't find the highest(high) only among the bars that have a minimum < than x.

Regards
Gioak

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Hi Gioak,

you can access the value for some reserved words like High by using a number within square brackets. Where the number specifies how many bars back from the currently processed bar you want to look at (while 0 is the most recent bar). Then you can compare this High and check it it matches your condition and only store it within a variable if it matches your condition and is higher than the currently stored value within the variable.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #8 (permalink)
cactus1973
Canicattė Italy
 
Posts: 15 since Nov 2018
Thanks Given: 0
Thanks Received: 0

HI ABCTG,
thanks for the suggestions, my difficulty is in finding the correct criterion to distinguish first only the bars that have a minimum of less than x and then be able to find among them (only among them) the bar with the highest max.

Regards
Gioak

Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

cactus1973,

I would suggest to start simple. Create a loop that simply finds the highest high over the last X bars, without using the highest high function. You would use a variable to store the highest high within the loop in, by checking if the High for the bar you are currently looking at is higher than the value stored in the variable. If it is, you update the variable, if if's not, you do nothing. The only thing to add would be to reset the variable each time before you start with the loop (for example by setting the variable value to -999999 to ensure that it can be updated to a new high and that you don't store old information in the variable).

Regards,

ABCTG


cactus1973 View Post
HI ABCTG,
thanks for the suggestions, my difficulty is in finding the correct criterion to distinguish first only the bars that have a minimum of less than x and then be able to find among them (only among them) the bar with the highest max.

Regards
Gioak


Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
cactus1973
Canicattė Italy
 
Posts: 15 since Nov 2018
Thanks Given: 0
Thanks Received: 0


HI ABCTG,
I think that highest high of x bars back is not useful, you don't need to know highest high unless it has a minimum lower than x.
Infact what you need to know with a loop from 0 to 5 is which lows are lower than X and then among them which one has the highest maximum, it will be A like pic. Between the 5 bars back there could be a higher high than A but if it doesn't have a minimum lower than x I don't care.

Regards,

Gioak

Attached Thumbnails
Click image for larger version

Name:	abc.jpg
Views:	267
Size:	85.3 KB
ID:	262711  
Reply With Quote




Last Updated on March 1, 2019


© 2024 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 - Privacy Policy - Downloads - Top
no new posts