Forex



Go Back   Forex Trading > Discussion Areas > Setup 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 02-03-2006, 07:18 PM
Junior Member
 
Join Date: Dec 2005
Posts: 1
nicugh is on a distinguished road
Help adding OBJ_TREND to indicator

//+------------------------------------------------------------------+
//| S_R trendline.mq4 |
//| Copyright © 2005, nicugh |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, nicugh"
#property link ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue

//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

IndicatorBuffers(2);

//---- drawing settings

SetIndexStyle(0,DRAW_LINE);
SetIndexDrawBegin(0,i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0,"Resistance");

ObjectCreate("Resistance", OBJ_TREND, 0, 0,v1[i],CurTime(),v1[i]);
//my problem is I can not create OBJ_TREND automaticaly
//it is created by the buffer's values only if it is compiled
//else (price 1=0, price2=0)
// and it is moved on the last line only when compiled
//I am not a programmer, can you help me, thank you

SetIndexStyle(1,DRAW_LINE);
SetIndexDrawBegin(1,i-1);
SetIndexBuffer(1, v2);
SetIndexLabel(1,"Support");

ObjectCreate("Support", OBJ_TREND, 0, 0,v2[i],CurTime(),v2[i]);
//my problem is I can not create OBJ_TREND automaticaly
//it is created by the buffer's values only if it is compiled
//else (price 1=0, price2=0)
// and it is moved on the last line only when compiled
//I am not a programmer, can you help me, thank you
return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("Resistance");
ObjectDelete("Support");

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

int start()
{
// int counted_bars=IndicatorCounted();

i=Bars;
while(i>=0)
{

val1 = iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0)
v1[i]=High[i];
else
v1[i] = v1[i+1];

val2 = iFractals(NULL, 0, MODE_LOWER,i);
if (val2 > 0)
v2[i]=Low[i];
else
v2[i] = v2[i+1];

i--;
}

}
//+------------------------------------------------------------------+

//my problem is I can not create OBJ_TREND automaticaly
//it is created by the buffer's values only if it is compiled
//else (price 1=0, price2=0)
// and it is moved on the last line only when compiled
//I am not a programmer, can you help me, thank you
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

Tags
OBJ_TREND


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
Help with adding colour to TSI indicator drgoodvibe Indicators - Metatrader 4 3 11-26-2006 05:18 AM
Adding MA to an Indicator PeaceLover Metatrader 4 10 09-18-2006 07:18 PM
help adding indicator as filter and to modify EAs Aaragorn Setup Questions 24 06-30-2006 11:01 AM
Help Adding Indicator To Expert jpsdyb Setup Questions 11 06-29-2006 03:42 AM
problem with adding indicator shiningstar Indicators - Metatrader 4 11 05-19-2006 04:25 PM


All times are GMT. The time now is 01:35 PM.



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