Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2007, 09:52 PM
Member
 
Join Date: Aug 2006
Posts: 49
dustovshio is on a distinguished road
ocean indicators

Hi I'm trying to make an indicator using Jim Slomans formula which is basically this:

Price average movement per unit time = price/ sqrt(totaltime)

for example you want to look at prices 40 bars back and compare them each to the current price like this 0-2, 0-4, 0-6 where the interval, and look back period are user defined. The difference is divided by the square root of the time interval. So for example price MathLog(P)*1000 = 300 over 11 bars. The average bar move is 300 / Mathsqrt(11). Finally you average all of the comparisons and plot your chart.

I don't have a problem getting the logs of the prices, but can't figure out how to store periodic differences divided by the square root of time. I've attached what code I have so far. Thanks , Dustin

//+------------------------------------------------------------------+
//| d.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

//---- input parameters
extern int period=40;
extern int interval=1;
extern bool fibo;
double ExtMapBuffer1 [];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle (0,DRAW_LINE);

SetIndexBuffer (0, ExtMapBuffer1);

string short_name = "It's working";
IndicatorShortName (short_name);


//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+

int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars<0) return (-1);
if (counted_bars>0) counted_bars--;
int count2=0, pos = Bars-counted_bars;
double pricearray[];
double logprice[];
double pricedif[][];
double pricesum;
double priceave;
double difsum, difave;
while (pos>=0)
{
pricearray[pos] = (Close[pos]*1000);
logprice[pos] = MathLog(pricearray[pos]*1000);
while (count2 <= period*interval)
{
pricedif[pos][count2] = logprice[pos]-logprice[pos-count2*interval];
pricesum = pricedif[pos][count2] + pricesum;
count2++;
}
priceave = pricesum/period; //sum of bars divided by total number
ExtMapBuffer1[pos] = priceave;
pos--;
}




//----

//----
return(0);
}
//+------------------------------------------------------------------+
Attached Files
File Type: mq4 d.mq4 (2.6 KB, 121 views)

Last edited by dustovshio; 06-20-2007 at 10:48 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 06-20-2007, 10:38 PM
iscuba11's Avatar
Senior Member
 
Join Date: May 2006
Location: Houston
Posts: 398
iscuba11 is on a distinguished road
Smile

Attach the indicator under Managing Attachments below the post!

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 12-27-2008, 08:52 PM
Junior Member
 
Join Date: Nov 2007
Posts: 29
quantwannabee is on a distinguished road
What? no Lagging squiggly lines! These guys will never work on this again-it might be meaningful. Try the Russians or the Chinese or the Indians or the Brazillians or the Albanians or the Romans or the Ancient Sumarians............. just not americans.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 12-28-2008, 05:22 AM
FXSamurai's Avatar
Member
 
Join Date: Aug 2006
Posts: 56
FXSamurai is on a distinguished road
Seems it was worked on at Need a Better Moving Average? Try the NMA.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Max number of indicators in indicators folder? moneyline Metatrader 4 23 05-29-2009 12:37 PM
applying indicators on indicators? tradesauce Indicators - Metatrader 4 15 12-17-2006 02:31 PM


All times are GMT. The time now is 02:49 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.