• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 12:32pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 12:32pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MT4 horizontal line base on price value indicator 17 replies

Simple horizontal with levels lines 2 replies

Fractal based trendline indicator, horizontal fractal S/R indicator 6 replies

00 & 50 levels horizontal lines indicator 1 reply

Vertical indicator windows & not horizontal? 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 16
Attachments: Horizontal Levels Indicator
Exit Attachments
Tags: Horizontal Levels Indicator
Cancel

Horizontal Levels Indicator

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Aug 13, 2013 9:58am Aug 13, 2013 9:58am
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
I need your help finding/coding an indicator that would allow me to draw multiple horizontal lines on the chart. I'm not after an indicator that paints pivot points or S/R levels, I want something where I can add the prices myself. I want to use the futures volume data from the eVOLution website by VolumeTrader. Every day new data is released so there would need to be 5 slots (one for every day of the week) and each has to have a custom color which can be changed (easy to distinguish between days). I've been adding these horizontal lines to the chart manually, but it takes up a lot of time and when new data comes in, finding the old ones and replacing them with the new ones takes ever more time. With an indicator described above, I would just erase the levels from the inputs and paste new price data and be done with it.

The reason I want to use this is that I've found the futures volume data to be quite useful in determining price targets once price has already started moving in the direction of the liquid price area. I don't know if an indicator like this exists and I'm not a coder, but if one cannot be found, I'd be very happy to see someone code the indicator.

This is what it should look like on the chart
Attached Image (click to enlarge)
Click to Enlarge

Name: random example chart.png
Size: 44 KB


This is my idea of the inputs UI
Attached Image


This is where I get the data from, price are separated by semicolons.
Attached Image (click to enlarge)
Click to Enlarge

Name: copy-paste.PNG
Size: 152 KB
If you don't risk, you don't ever have to lose.
  • Post #2
  • Quote
  • Edited 6:19pm Aug 13, 2013 6:05pm | Edited 6:19pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Try the following script.

Download .mq4 and .ex4 files into .../experts/scripts folder.
Download .mqh files into .../experts/include folder.
Restart MT4.

1. Drag the script from MT4's Navigator onto your chart.
2. Click the Load button to load any previously saved set of values (this saves having to type them in each time).
3. Make any additions or changes to levels. Separate multiple levels for same day using semi-colons (; ).
4. Click the Save button to save the current settings.
5. Click OK and the script will plot the lines on your chart.

The script removes all lines plotted by a previous run of the script, and then (re-)plots lines at the levels you've specified.
However, if you want to retain the previous lines, set DeletePreviousLines to FALSE.
Hence, to remove all previously plotted lines, simply perform steps 1 and 5 (DeletePreviousLines is set to TRUE by default).

You can use the Save button to create as many files as you need, e.g. different file names for different currency pairs, different weeks, puts as opposed to calls, etc. And then retrieve previous levels by loading the required file(s).

That's the best that I can do, given the limitations imposed by MT4, and the time that I have available.
(I chose a script instead of an indicator, because scripts allow the use of the Load/Save buttons).
Attached File(s)
File Type: mq4 Options Levels.mq4   3 KB | 1,641 downloads
File Type: ex4 Options Levels.ex4   29 KB | 1,130 downloads
File Type: mqh hanover --- function header (np).mqh   13 KB | 1,155 downloads
File Type: mqh hanover --- extensible functions (np).mqh   116 KB | 1,157 downloads
 
 
  • Post #3
  • Quote
  • Aug 13, 2013 7:55pm Aug 13, 2013 7:55pm
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
Hi David,
thank you so much for popping in and devoting some of your time to code this thing. I know you're a busy man and you've other things to do than write pieces of code for FF folk and I want you to know that I really appreciate your time and effort. The coding you did works just the way I imagined it would, even better in fact. The option to save the data is really something I didn't see coming and it's a great addition. Wow. Thanks again!

Attached Image (click to enlarge)
Click to Enlarge

Name: cool.png
Size: 51 KB
If you don't risk, you don't ever have to lose.
 
 
  • Post #4
  • Quote
  • Edited 10:02am Aug 14, 2013 2:08am | Edited 10:02am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
@bug: no problem, glad you're happy with it.
_____________________

@anybody: attached is an indicator (NOT script) that plots call and put levels from the CME webpage. I wrote it for a client a few months ago, but he hasn't paid me for the work, so I'll post it publicly.

Download .mq4 and .ex4 files below into .../experts/indicators folder.
Download .mqh files from post #2 into .../experts/include folder.
Restart MT4.

1. Go to the webpage in the link above. Select your desired settings from the dropdowns (Trade Date, Type, Expiration).
2. Press Ctrl-A to select the entire page, Ctrl-C to copy it, and Ctrl-V to paste it into an empty text file (use a text editor like Notepad).
3. Save the text file in the .../experts/files folder, under the name CMEOPT_EURUSD.TXT (if EURUSD is the relevant currency pair). Overwrite any existing file of the same name.
4. Attach the indicator to a EURUSD chart. The indy will plot all of the put and call lines within TolerancePips of the current price.
Set LineLength to 0, if you want a horizontal line across the width of the whole chart.
InputFilename should match the file name you used in step 3; the wildcard [sym] will automatically insert the symbol of the chart (e.g. EURUSD) to which the indy is attached (hence the levels will be automatically read from the correct file, whenever you switch to a different pair).
The other settings should be self-explanatory.

Press F8 in MT4 and check 'Show object descriptions' ON, and you'll be able to see the call/put data above the plotted line. Or simply hover the mouse cursor over the line, and the data will display in the pop-up help bubble.

Every time data on the CME webpage is updated, you'll need to re-run steps 1,2,3 to update the file. Then the indy will read and plot the updated data.

If CME changes the HTML content/format of their webpage, then the indy will probably no longer work.
Attached File(s)
File Type: ex4 CME options levels.ex4   40 KB | 1,224 downloads
File Type: mq4 CME options levels.mq4   7 KB | 1,483 downloads
 
 
  • Post #5
  • Quote
  • Aug 14, 2013 5:30am Aug 14, 2013 5:30am
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
Cool. Thanks!
If you don't risk, you don't ever have to lose.
 
 
  • Post #6
  • Quote
  • Sep 1, 2013 1:28am Sep 1, 2013 1:28am
  •  mobthehop
  • | Joined May 2010 | Status: Member | 215 Posts
Hanover, in the hope that you drop by sooner or later....

1. Put the two mqh files from post #2 into .../include folder
2. Put both files from post #4 in indicator folder
3. For testing purposes, replicated your EUDUSD example, put corresponding .txt file into .../files folder, also attached (dd 2013-08-31)
4. Started MT4:
- attached is the error log generated from CME options levels
- data window shows error CMEOPT_EURUSD.TXT not found, thought the file is there.

I am on MT4 built 509

Any advise to make this work is highly appreciated

Thanks in advance / Mop
Attached File(s)
File Type: txt CME options levels.txt   6 KB | 613 downloads
File Type: txt CMEOPT_EURUSD.TXT.txt   12 KB | 603 downloads
 
 
  • Post #7
  • Quote
  • Sep 1, 2013 3:41am Sep 1, 2013 3:41am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting mobthehop
Disliked
Hanover, in the hope that you drop by sooner or later.... 1. Put the two mqh files from post #2 into .../include folder 2. Put both files from post #4 in indicator folder 3. For testing purposes, replicated your EUDUSD example, put corresponding .txt file into .../files folder, also attached (dd 2013-08-31) 4. Started MT4: - attached is the error log generated from CME options levels - data window shows error CMEOPT_EURUSD.TXT not found, thought the file is there. I am on MT4 built 509 Any advise to make this work is highly appreciated Thanks in...
Ignored
Warning errors during compile don't matter.
Check that file name ends in .txt (the one you posted ends with .txt.txt) and resides in ..../experts/files folder.
Check that you're on correct currency pair's chart.

I downloaded your file and renamed it to CMEOPT_EURUSD.TXT
Then attached indy onto EURUSD chart using default parameter settings, and got the result in attached screenshot.
I am running Windows XP SP2, Pepperstone MT4 build 500. Yours could be a Vista/Win7/Win8 permissions problem (jnfo here).
Attached Image (click to enlarge)
Click to Enlarge

Name: Image 100.png
Size: 42 KB
 
 
  • Post #8
  • Quote
  • Sep 1, 2013 8:11am Sep 1, 2013 8:11am
  •  mobthehop
  • | Joined May 2010 | Status: Member | 215 Posts
Hanover,

thanks a lot - no idea how I ended up with double txt extension - fixed it & now works as per your image

Thanks for the coding and for answering my question so quickly!

Cheers / Mop
 
 
  • Post #9
  • Quote
  • Sep 3, 2013 5:10pm Sep 3, 2013 5:10pm
  •  TPiFX
  • | Joined Jun 2013 | Status: Junior Member | 1 Post
This is excellent but it looks like the CME already changed the HTML and continues to do so every week. Any way to bypass this?
 
 
  • Post #10
  • Quote
  • Oct 12, 2013 1:13pm Oct 12, 2013 1:13pm
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
Quoting TPiFX
Disliked
This is excellent but it looks like the CME already changed the HTML and continues to do so every week. Any way to bypass this?
Ignored
Yeah, that doesn't seem to be working anymore, but VolumeTrader has a special indicator for plotting option levels so you can probably use that. I care more about the futures transactions levels as it helps to pinpoint liquid areas, sometimes turning points as well.
If you don't risk, you don't ever have to lose.
 
 
  • Post #11
  • Quote
  • Oct 12, 2013 2:25pm Oct 12, 2013 2:25pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting TPiFX
Disliked
This is excellent but it looks like the CME already changed the HTML and continues to do so every week. Any way to bypass this?
Ignored
No change to the HTML that I'm aware of. The indicator still works fine for me:

  1. Follow the instructions in post #4 carefully.
  2. Make sure that you name the file correctly in step 3 (if you don't, you'll get an error message in the top left corner of the main chart).
  3. Make sure you attach the indy to the correct chart (e.g. a EURUSD chart, if you captured EURUSD data from the CME website).
  4. Use the indy's default parameter settings.

Result shown in screenshot.

Attached Image (click to enlarge)
Click to Enlarge

Name: Image 129.png
Size: 22 KB
 
 
  • Post #12
  • Quote
  • Edited 5:25am Oct 13, 2013 5:10am | Edited 5:25am
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
Hi David,
thanks for popping in. I just updated to W8 so that might be an issue, but truth be told, I didn't spend a lot of time on trying to find the fault. It's good to hear the options website is still functional with the indicator you so kindly provided. I'll have another look at it, but as I said before, I'm perfectly happy with the futures data.
Thanks for your time, David!

EDIT.
Well I spent some additional time trying to get it to work, but no luck. I've installed MT4 into a non-program files folder so that can't be the issue. The MT4 journal tells me the indicator was loaded successfully, so I've no idea what's going on.
If you don't risk, you don't ever have to lose.
 
 
  • Post #13
  • Quote
  • Oct 17, 2013 2:44am Oct 17, 2013 2:44am
  •  timilica
  • | Joined Oct 2013 | Status: Junior Member | 5 Posts
Hello guys,
I have found an indicator called Effort index code it for Amibroker. I think it'll be helpful to have it for MT4, because i couldn't find a similar version. It could be helpful in combination with other indicators such as Better volume.

Unfortunately I don't use Amibroker, therefore, I don't really know the logic behind this AFL code.
Attached you can view the afl file.

Information and logic for this indicator are here:
karthikmarar.blogspot.ro/2013/06/effort-index-afl.html
www.youtube.com/watch?v=iyD3TZTaxmk


kind regards
Attached File(s)
File Type: zip Effort Index V.1.0.afl.zip   < 1 KB | 634 downloads
 
 
  • Post #14
  • Quote
  • Feb 12, 2014 7:53am Feb 12, 2014 7:53am
  •  will80
  • | Joined Mar 2012 | Status: Member | 15 Posts
Hi Hanover - i was hoping you could help me with a simple script that is similar to your options level work. Prior to the MT4 6 build this script would run perfectly after copying to clipboard the levels below (price level -1st line, then its description below it), now it compiles and loads but does not plot any lines. I am taking orderflow information copied from various sources like IFR or MNI in this format:

1.3690
Strong offers Large stops on break
1.3686
50% 1.3894 1.3477 Stops on break
1.3680
Strong offers 1.3683 Feb11 high
1.3661
61.8% 76.4% 1.3683 26
1.3656
50 dma
1.3648
38.2% 50% 1.3683 26
1.3647
Int.Day high Europe, Asia 1.3641
1.3626
Int.Day low Asia (76.4% 1.3609 83)
1.3612
100dma Feb10 low
1.3600
Medium demand 1.3602 61.8% 1.3552 1.3683
1.3598
21dma Cloud base
1.3585
76.4% 1.3552 1.3683 1.3580 50% 1.3477 1.3683
1.3560
Strong demand 1.3552 Friday Feb7 low
1.3525
Medium demand

Source code below:

//+------------------------------------------------------------------+
//| IFR Levels.mq4 |
//| Copyright 2012, philuk |
//| email: [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, philuk"
#property link "[email protected]"

#import "kernel32.dll"
string GlobalLock(int hMem);
int GlobalUnlock(int hMem);
#import

#import "user32.dll"
int OpenClipboard(int hOwnerWindow);
int CloseClipboard();
int GetClipboardData(int Format);
#import

int resistanceColour = Black;
int supportColour = Black;
int lineStyle = STYLE_DOT;
int lineWidth = 1;
int lineDescColour = Black;

string hLinePrefix = "IFR_Level_";

//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
string hLineStr;
int hLineColour = resistanceColour;
string objName;
string myClipboardText;

if (OpenClipboard(0) != 0)
{
int hMem = GetClipboardData(1); //CF_TEXT
if (hMem != 0)
{
myClipboardText = GlobalLock(hMem);
GlobalUnlock(hMem);

// Delete existing horizontal lines
int objTotal = ObjectsTotal();

for (int i = objTotal - 1; i >= 0; i--)
{
objName = ObjectName(i);

if (ObjectType(objName) == OBJ_HLINE)
{
if (StringFind(objName, hLinePrefix) == 0)
{
ObjectDelete(objName);
}
}
}

// Loop through copied clipboard generating horizontal lines
int pos = 0;
int index;
string levelStr;
double level;
double prevLevel = 0.0;
string techSigStr;

while (pos < StringLen(myClipboardText))
{
// Find first separator
index = StringFind(myClipboardText, "\r\n", pos);
if (index == -1) break;

levelStr = StringSubstr(myClipboardText, pos, index - pos);
level = StrToDouble(levelStr);
pos = index + 2;

// Find end of line - if not found then assume this is the last line
index = StringFind(myClipboardText, "\r\n", pos);
if (index == -1) index = StringLen(myClipboardText);

techSigStr = StringSubstr(myClipboardText, pos, index - pos);

// Create horizontal line
hLineStr = StringConcatenate(hLinePrefix,DoubleToStr(level, 4));
pos = index + 2; // Move forwards, ready for next line

// Is this level the current price? ASSUMES hh:mm at start of Technical Significance
if (StringGetChar(techSigStr, 2) == ':')
{
// A bit rubbish
string digits = "0123456789";
if ((StringFind(digits, CharToStr(StringGetChar(techSigStr, 0))) != -1) &&
(StringFind(digits, CharToStr(StringGetChar(techSigStr, 1))) != -1) &&
(StringFind(digits, CharToStr(StringGetChar(techSigStr, 3))) != -1) &&
(StringFind(digits, CharToStr(StringGetChar(techSigStr, 4))) != -1))
{
// Skip this level, but change from resistance to support
hLineColour = supportColour;
prevLevel = level;
continue;
}
}

// Same level already used?
if (level == prevLevel)
{
// Just update description of line
string hLineDesc = StringConcatenate(ObjectDescription(hLineStr), " & ", techSigStr);

ObjectSetText(hLineStr, hLineDesc, 8, "Arial", lineDescColour);
}
else
{
ObjectCreate(hLineStr, OBJ_HLINE, 0, 0, level);
ObjectSetText(hLineStr, techSigStr, 12, "Arial", lineDescColour);
ObjectSet(hLineStr, OBJPROP_COLOR, hLineColour);
ObjectSet(hLineStr, OBJPROP_STYLE, lineStyle);
ObjectSet(hLineStr, OBJPROP_WIDTH, lineWidth);
}

prevLevel = level;
}

CloseClipboard();
}
}

return(0);
}
//+------------------------------------------------------------------+

Any help you can give would be most appreciated,
Kind Regards,
Will
 
 
  • Post #15
  • Quote
  • Feb 12, 2014 1:58pm Feb 12, 2014 1:58pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting will80
Disliked
Hi Hanover - i was hoping you could help me with a simple script that is similar to your options level work. ......
Ignored
Sorry, but as I've pointed out elsewhere, I don't know how to code in MT4 build 600's new programming language. All I can suggest is that you take the EX4 file from build 509 and copy it to the ..../MQL4/Scripts folder in your MT4 build 600. MetaQuotes assure us that EX4s that ran in earlier builds will continue to do so in build 600 onward.
 
 
  • Post #16
  • Quote
  • Feb 13, 2014 9:20am Feb 13, 2014 9:20am
  •  will80
  • | Joined Mar 2012 | Status: Member | 15 Posts
Thanks Hanover - I tried that and it's still not working. Thank you though for responding
 
 
  • Post #17
  • Quote
  • Apr 15, 2014 1:05am Apr 15, 2014 1:05am
  •  wongpasar
  • | Joined Jan 2014 | Status: Member | 27 Posts
Quoting bug
Disliked
{quote} Yeah, that doesn't seem to be working anymore, but VolumeTrader has a special indicator for plotting option levels so you can probably use that. I care more about the futures transactions levels as it helps to pinpoint liquid areas, sometimes turning points as well.
Ignored
hi bug!
thanks for your idea about using levels on evolution trading website..
and thanks to.. hannover who did an amazing work for this..

but i just wandering how could this data help you in your trading startegies..??
since the data are lag... -_-'
i tried this script on tuesday nearly london OP market.. but i couldnt get futures data on monday from evolution website..

so i used friday data.. and it look like this :

Attached Image (click to enlarge)
Click to Enlarge

Name: horizontal level future EU.jpg
Size: 166 KB


so my opinion.. this could be so help full when we can get data on real time..

see market on friday on that chart?? market moved to level which is guessed..

maybe i miss one or more things from your insight.. wish you could share your method further..

god bless you two..
 
 
  • Post #18
  • Quote
  • Apr 18, 2014 3:15pm Apr 18, 2014 3:15pm
  •  bug
  • Joined Jan 2010 | Status: cash is a position too | 958 Posts
Quoting wongpasar
Disliked
{quote} hi bug! thanks for your idea about using levels on evolution trading website.. and thanks to.. hannover who did an amazing work for this.. but i just wandering how could this data help you in your trading startegies..?? since the data are lag... -_-' i tried this script on tuesday nearly london OP market.. but i couldnt get futures data on monday from evolution website.. so i used friday data.. and it look like this : {image} so my opinion.. this could be so help full when we can get data on real time.. see market on friday on that chart??...
Ignored
Well, the idea behind that is really simple, in fact. Even though a lot of FX trading takes place on the spot market, futures volume is still relevant. Since data on spot FX transactions is impossible to come by (of course in-house traders in large FX dealers have the data, but they're not about to share it with anyone), I opted for futures data as a proxy. So with that in mind I wanted to look for data that could give some insight where the liquidity was - ie. price ranges in which market participants were willing to buy and sell with above average volume. Some might think that outdated information is useless, but I've observed that these volume levels (specifically areas around a specific price) tend to act as support and resistance, or at the very least, medium term stopping points before a continuation as momentum builds up.

I've found that it's best to use this data when setting price targets. I use price action, a few select indicators and the news feed to give me a sense of where the market is headed and only then do I use futures volume data. Let's say the previous week was bearish and the market tumbled 320 pips. There's really no point in looking at levels from the previous week and fantasizing about the market hitting them this week if the trend is still bearish. However, if the trend has changed then you could do very well indeed by using the volume levels as you exit points.

If you want to know more about this stuff I suggest you look into market profile. The company that provides the futures data, CME, has a nice presentation on it here. Also, check out these links:
http://www.forexfactory.com/showthread.php?t=247606
http://www.forexfactory.com/showthread.php?t=38423
http://www.forexfactory.com/showthread.php?t=274208
http://www.forexfactory.com/showthread.php?t=277925

There's plenty more where that came from but I don't want to inundate you with all of it. If you're still interested after reading through the links above, try searching this site and others for: market profile, volume profile, order flow, forex volume. Go for the free stuff first and only pay for stuff once you're absolutely sure you're not being taken for a ride.
If you don't risk, you don't ever have to lose.
 
 
  • Post #19
  • Quote
  • Jun 17, 2016 12:22pm Jun 17, 2016 12:22pm
  •  Jbfx
  • | Joined May 2016 | Status: Member | 28 Posts
Hi Hanover,

Thank you so much for this indicator, been looking all over the place for something with this function.

I want to use it for a slightly different use than volumes. I want to be able to plot significant levels on each Time frame instead of each day, and also to plot Golden price levels (http://www.forexfactory.com/showthread.php?t=584705)

This will allow me to differentiate between the different timeframes with coloured lines and also save them for each pair and allow me to load them again.

As far as I can see, I had a look at the code and tried myself to change the names Monday, Tuesday, Friday etc to Monthly, Weekly, Daily, 4H, Hourly, All-time (Highs and Lows) and Golden Price but i broke the code. I've never coded before but thought it would be as simple as just changing the name in Meta-editor. I was obviously wrong.

Now i'm back here with hat in hand, can you please advise how i would change the names and add some extra slots in there for those required frames?

I would be eternalllllly grateful. Thanks.
 
 
  • Post #20
  • Quote
  • Jun 18, 2016 2:46am Jun 18, 2016 2:46am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting Jbfx
Disliked
can you please advise how i would change the names and add some extra slots in there for those required frames?
Ignored
I might look at this at some future point, but no promises. I don't have time to read Quinton's thread, as I'm currently busy with other projects, and I'm not sure when I'll get around to anything else.

You could try posting the source code in one of the "I code your indicators for free" threads, and perhaps somebody will help you. Or if you're willing to pay for help, you could try MQL or elance.
 
 
  • Platform Tech
  • /
  • Horizontal Levels Indicator
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023