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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Referencing higher timeframe data in an indicator 2 replies

Referencing offline charts for tick chart EAs 0 replies

Have a problem referencing iCustom 3 replies

Referencing Indicator Arrays. 4 replies

IB referencing to my account 12 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Referencing custom indicator data
Cancel

Referencing custom indicator data

  • Post #1
  • Quote
  • First Post: Oct 23, 2014 1:16am Oct 23, 2014 1:16am
  •  ra457
  • | Joined Mar 2007 | Status: Sleep deprived | 81 Posts
I have a collection of a few simple indicators spread out over 3 time frames in an MT4 template. The indicators all appear to boil down to one crucial point or argument somewhere in the code to say something similar to:

Inserted Code
if (Variable1 > 0)
{chart something this way};
else if (Variable1 < 0)
    {chart it another way};

There are probably errors in that simple example because I am authentically bad at programming. But I'm just trying to show that Variable1 is the primary deciding factor of how that particular indicator displays its custom chart objects.

My question is--

How do I write a new script to export this Variable1 value to a CSV file without including all the math from the original indicator? Is that even possible with iCustom?


So let's say:

Indicator1 has a crucial variable somewhere of Variable1 on H1
And Indicator2 has a crucial variable somewhere of Variable2 on H4
And Indicator3 has a crucial variable somewhere of Variable3 on D1

I ultimately want to write a script to process each of the three indicators and spit out a CSV as follows:
Inserted Code
FileWrite(handle,"SYMBOL_Indicator1",DoubleToStr(Variable1,4),"SYMBOL_Indicator2",DoubleToStr(Variable2,4),"SYMBOL_Indicator3",DoubleToStr(Variable3,4));

I'm under the impression iCustom is needed but that's sheer ignorance. Can I just use iCustom to pull the value of ***any*** defined variable from inside the custom indicator from like... anywhere inside the guts of that custom indicator...?? Or... does the custom indicator itself always run top to bottom on the symbol and time frame and end with certain values for the variables and only those variables are available with iCustom?

Clearly I have no idea what I'm doing. But I know what I'm trying to accomplish. Hopefully my words didn't make your heads explode. Any advice would be appreciated.

Thanks.
  • Post #2
  • Quote
  • Oct 23, 2014 3:41am Oct 23, 2014 3:41am
  •  Ralome
  • Joined Nov 2011 | Status: Ups and downs | 289 Posts
Hi Ra457,

1. iCustom can pull the values of the indicator buffers only, i.e., taking the MACD as an example, these two:

Inserted Code
SetIndexBuffer(0,MacdBuffer);
SetIndexBuffer(1,SignalBuffer);

2. If you want to get some variable value, FileWrite is one way to go, yes.

3. But you can't do that with scripts, you have to include the FileWrite in each of the indicators (you said you had three on three different charts).

Greets,
Ralome
Even if you fall on your face, you're still moving forward.
 
 
  • Post #3
  • Quote
  • Last Post: Oct 30, 2014 11:33pm Oct 30, 2014 11:33pm
  •  ra457
  • | Joined Mar 2007 | Status: Sleep deprived | 81 Posts
Thanks, Ralome. The 3 indicators are all on the same chart... just different time frames.

Assuming I can locate the appropriate buffers that have the values I want inside the 3 indicators, how do I get that instantaneous value into a double format variable so I can put that into a filewrite command?

EDIT I am so bad at this shit. Should have just googled. Thanks for the direction.

Literally just googled mt4 icustom to double.

Thanks,

R
 
 
  • Platform Tech
  • /
  • Referencing custom indicator data
  • Reply to Thread
0 traders viewing now
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