Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-04-2006, 11:41 PM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
how to

im litle stucked i want to use just opened candle and not previus i tryed to change things in the code but im getting many errors this is a peace of the code

for (shift=CountDays-1;shift>=0;shift--)
{
time1=iTime(NULL,PERIOD_D1,shift);
i=shift-1;
if (i<0)
time2=Time[0];
else
time2=iTime(NULL,PERIOD_D1,i)-Period()*60;

high = iHigh(NULL,PERIOD_D1,shift+1);
low = iLow(NULL,PERIOD_D1,shift+1);
open = iOpen(NULL,PERIOD_D1,shift+1);
close = iClose(NULL,PERIOD_D1,shift+1);


please give a hint

sailor the bad code reader
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-05-2006, 01:09 PM
Mohammed's Avatar
Mohammed Mohammed is offline
Senior Member
 
Join Date: Mar 2006
Posts: 119
Mohammed is on a distinguished road
Unhappy

Quote:
Originally Posted by sailor
im litle stucked i want to use just opened candle and not previus i tryed to change things in the code but im getting many errors this is a peace of the code

for (shift=CountDays-1;shift>=0;shift--)
{
time1=iTime(NULL,PERIOD_D1,shift);
i=shift-1;
if (i<0)
time2=Time[0];
else
time2=iTime(NULL,PERIOD_D1,i)-Period()*60;

high = iHigh(NULL,PERIOD_D1,shift+1);
low = iLow(NULL,PERIOD_D1,shift+1);
open = iOpen(NULL,PERIOD_D1,shift+1);
close = iClose(NULL,PERIOD_D1,shift+1);


please give a hint

sailor the bad code reader
sailor,
We have to see the complete code to help.
For example I don't know what's the CountDays is (I have to see the declaration of it) and i varaible too.
__________________
There is a fine line between freedom of expression and hate literature.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-05-2006, 02:49 PM
sailor sailor is offline
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
here it is im not done yet with modifying



------------------------------------------------------------------------



//+------------------------------------------------------------------+
//| AllPivots_v1.mq4 |
//| Copyright © 2006, Forex-TSD.com |
//| Written by IgorAD,igorad2003@yahoo.co.uk |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Forex-TSD.com "
#property link "http://www.forex-tsd.com/"

#property indicator_chart_window

extern int CountDays=10;
extern bool Plot_pivots=true;
extern bool Plot_middle=false;
extern bool Plot_camarilla=false;

datetime time1;
datetime time2;
double open,close,high,low;
double P,R1,R2,R3,S1,S2,S3,M0,M1,M2,M3,M4,M5;
double H1,H2,H3,H4,L1,L2,L3,L4,Range;
double pstyle, mstyle,cstyle;
int shift, num;

void ObjDel()
{
for (;num<=CountDays;num++)
{
ObjectDelete("PP["+num+"]");
ObjectDelete("R1["+num+"]");
ObjectDelete("R2["+num+"]");
ObjectDelete("R3["+num+"]");
ObjectDelete("S1["+num+"]");
ObjectDelete("S2["+num+"]");
ObjectDelete("S3["+num+"]");


}
}

void PlotLine(string name,double value,double line_color,double style)
{
ObjectCreate(name,OBJ_TREND,0,time1,value,time2,va lue);
ObjectSet(name, OBJPROP_WIDTH, 1);
ObjectSet(name, OBJPROP_STYLE, style);
ObjectSet(name, OBJPROP_RAY, false);
ObjectSet(name, OBJPROP_BACK, true);
ObjectSet(name, OBJPROP_COLOR, line_color);
}
int init()
{

return(0);
}


int deinit()
{
ObjDel();
Comment("");
return(0);
}

int start()
{
int i;

ObjDel();
num=0;

for (shift=CountDays-1;shift>=0;shift--)
{
time1=iTime(NULL,PERIOD_D1,shift);
i=shift-1;
if (i<0)
time2=Time[0];
else
time2=iTime(NULL,PERIOD_D1,i)-Period()*60;

high = iHigh(NULL,PERIOD_D1,shift+1);
low = iLow(NULL,PERIOD_D1,shift+1);
open = iOpen(NULL,PERIOD_D1,shift+1);
close = iClose(NULL,PERIOD_D1,shift+1);

P = open;

R1 = P+(55*Point);
R2 = P+(89*Point);
R3 = P+(144*Point);

S1 = P-(55*Point);
S2 = P-(89*Point);
S3 = P-(144*Point);



time2=time1+PERIOD_D1*60;

pstyle=0;
mstyle=3;
cstyle=1;
num=shift;

PlotLine("PP["+num+"]",P,Aqua,pstyle);
if(Plot_pivots)
{

PlotLine("R1["+num+"]",R1,Red,pstyle);
PlotLine("R2["+num+"]",R2,Orange,pstyle);
PlotLine("R3["+num+"]",R3,Gold,pstyle);

PlotLine("S1["+num+"]",S1,MediumSeaGreen,pstyle);
PlotLine("S2["+num+"]",S2,Lime,pstyle);
PlotLine("S3["+num+"]",S3,GreenYellow,pstyle);
}



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




sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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



All times are GMT. The time now is 11:10 AM.