iSMI function needed

If you don't know where to start, start here! Don't be afraid to ask questions.

Moderator: moderators

User avatar
MarketSlayer
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon Aug 31, 2009 10:57 pm
Reputation: 0
Gender: Male
Contact:

iSMI function needed

Postby MarketSlayer » Tue Sep 15, 2009 1:57 am

I found the code for a SMI Stochastic Momentum Indicator and I have no clue how to add this code to a library or something so I can call it like I do iStochastic etc.
Anyone know how to do it.....
See attached SMI indicator for the source code....
Thanks
Attachments
MS SMI.mq4
(3.89 KiB) Downloaded 215 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
rowdy
rank: 150+ posts
rank: 150+ posts
Posts: 157
Joined: Fri Feb 20, 2009 1:22 pm
Reputation: 1
Location: Murfreesboro, Tennessee
Gender: Male

Re: iSMI function needed

Postby rowdy » Tue Sep 15, 2009 9:31 am

MarketSlayer wrote:I found the code for a SMI Stochastic Momentum Indicator and I have no clue how to add this code to a library or something so I can call it like I do iStochastic etc.
Anyone know how to do it.....
See attached SMI indicator for the source code....
Thanks


Shut down MT4. Move this file to the Program Files/MetaTrader4/Experts/Indicators folder. Restart MT4. You will see it show up in the custom indicators panel in MT4 Navigator. Drag and drop into chart.

If your question is about how to call it up in a program, then you need to use the iCustom function in mql4. Go to www.mql4.com for more details.
All I need is Supply and Demand

User avatar
MarketSlayer
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon Aug 31, 2009 10:57 pm
Reputation: 0
Gender: Male
Contact:

Postby MarketSlayer » Tue Sep 15, 2009 1:20 pm

Yes, my question is how to make it a function that I call and pass the same parameters to it, just like iStochastic etc. I would like to be able to retrieve this across time frames etc etc...I am not sure how to modify the code to call the data from different time frames. Can anyone help on this?
Thanks

User avatar
rowdy
rank: 150+ posts
rank: 150+ posts
Posts: 157
Joined: Fri Feb 20, 2009 1:22 pm
Reputation: 1
Location: Murfreesboro, Tennessee
Gender: Male

Postby rowdy » Wed Sep 16, 2009 12:16 am

MarketSlayer wrote:Yes, my question is how to make it a function that I call and pass the same parameters to it, just like iStochastic etc. I would like to be able to retrieve this across time frames etc etc...I am not sure how to modify the code to call the data from different time frames. Can anyone help on this?
Thanks


Slayer,
Use iCustom-
http://docs.mql4.com/indicators/iCustom

double val=iCustom(NULL, 0, "MS SMI",0,0); returns the current value for the white line on the current chart timeframe.
double val=iCustom(NULL, PERIOD_H1, "MS SMI",1,0); returns the current value for the red line on the H1 timeframe.

If you want to pass values, MS SMI uses four external inputs-

Period_Q
Period_R
Period_S
Signal

To Pass 5,6,7,2 on the M15 timeframe and get the value for the white line-
double val=iCustom(NULL, PERIOD_M15, "MS SMI",5,6,7,2,0,0);
All I need is Supply and Demand

User avatar
MarketSlayer
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon Aug 31, 2009 10:57 pm
Reputation: 0
Gender: Male
Contact:

Postby MarketSlayer » Wed Sep 16, 2009 12:59 am

I did use that, thanks soo much, that was great to get to work finally....

One item I am struggling with is the hard coding of a pair/currency... I want to create a dashboard with a list of multiple pairs.
When I set the symbol ="EURUSD" it bombs.

double a = iCustom(symbol,i, "MS SMI", 5,6,7,2,0,0) ;// Fast Line
double b = iCustom(symbol,i, "MS SMI", 5,6,7,2,1,0) ; // Slow Line

Any ideas??

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
rowdy
rank: 150+ posts
rank: 150+ posts
Posts: 157
Joined: Fri Feb 20, 2009 1:22 pm
Reputation: 1
Location: Murfreesboro, Tennessee
Gender: Male

Postby rowdy » Wed Sep 16, 2009 9:43 am

MarketSlayer wrote:I did use that, thanks soo much, that was great to get to work finally....

One item I am struggling with is the hard coding of a pair/currency... I want to create a dashboard with a list of multiple pairs.
When I set the symbol ="EURUSD" it bombs.

double a = iCustom(symbol,i, "MS SMI", 5,6,7,2,0,0) ;// Fast Line
double b = iCustom(symbol,i, "MS SMI", 5,6,7,2,1,0) ; // Slow Line

Any ideas??


Not sure, make sure symbol is defined as a string. Try using "EURUSD" instead of the variable symbol in the iCustom and see if that works. Also, do a search of iCustom in www.mql4.com. Here is a thread that may offer some help-
http://forum.mql4.com/21870
All I need is Supply and Demand

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 2
Gender: Male
Contact:

Postby flinux » Wed Sep 16, 2009 8:31 pm

A dashboard like that ?

Image

:wink:

User avatar
MarketSlayer
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon Aug 31, 2009 10:57 pm
Reputation: 0
Gender: Male
Contact:

Postby MarketSlayer » Thu Sep 17, 2009 11:37 am

Sure, what did you do to make it work across pairs? Can you post your code please?
Thanks, this looks great..I am struggling with the just showing an icon or the value of the indicator....

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 2
Gender: Male
Contact:

Postby flinux » Thu Sep 17, 2009 12:11 pm

OK.
Enjoy it.
Attachments
FLI_MP_MSSMI.mq4
(3.29 KiB) Downloaded 191 times

User avatar
MarketSlayer
rank: <50 posts
rank: <50 posts
Posts: 23
Joined: Mon Aug 31, 2009 10:57 pm
Reputation: 0
Gender: Male
Contact:

Postby MarketSlayer » Thu Sep 17, 2009 12:40 pm

Nice work my comrad....
I had to update one piece for my Forex.com platform/feed.
string q[] = {"EURUSDFXF","GBPUSDFXF","USDJPYFXF","EURJPYFXF","GBPJPYFXF","USDCHFFXF","USDCADFXF","NZDUSDFXF"};
I updated the suffix to the pair text label... ahhhhhh that was the missing link.
QUESTION - explain your letters...is it B=Buy, S=Sell, W=Wait??
Thanks again.
Great lesson learned here..
Slayer of the Markets....LOL

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “beginners forum”