one to one coaching

hi all codeing experts can you tell me exact logic of this code . please help.

debashis

Member
hi all codeing experts
You must be registered for see images
can you tell me exact logic of below code . please help.


#property indicator_chart_window
#property indicator_buffers 2
#property indicator_width1 2
#property indicator_color1 Lime
#property indicator_width2 2
#property indicator_color2 Red
extern int qual=5;
extern int len=5;
extern int Distance = 1;
extern int Countbars=1000;
double Up[];
double Dn[];
double point;
double bs=0;
double index=0;
double bindex=0;
double sindex=0;
double length=0;
double ret=0;
int init() {
if(Digits==3 || Digits==5) {
point=10*Point;
}
else{
point=Point;
}
IndicatorBuffers(2);
SetIndexStyle(0, DRAW_ARROW);
SetIndexBuffer(0, Up);
SetIndexArrow(0,161);
SetIndexStyle(1, DRAW_ARROW);
SetIndexBuffer(1, Dn);
SetIndexArrow(1,161);


return (0);
}
int deinit() {
return (0);
}
int start() {
bool TurnedUp = false;
bool TurnedDown = false;
double highest,lowest;
int i,limit,limit2;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);

limit=Countbars-counted_bars;
if (i> limit2)
limit2= i;
if (limit2 <Countbars-1)
limit =Countbars- 1;

for( i=limit; i>=0; i--) {
if (Close>Close[i+4]){
bindex=bindex+1;
}
if(Close<Close[i+4]){
sindex=sindex+1;
}
ret=0;
index=0;


if ((bindex>qual) && (Close<Open)&& (High>=High[iHighest(Symbol(),0,MODE_HIGH,len,i+1)])) {
index=1;
bindex=0;
ret=-1;
}
if ((sindex>qual) && (Close>Open)&& (Low<= Low[iLowest(Symbol(),0,MODE_LOW,len,i+1)])) {
index=-1;
sindex=0;
ret=1;
}
if (ret==1 && i!=0){
Up=Low-Distance*point;
}
if (ret==-1 && i!=0){
Dn=High+Distance*point;
}
}

if (i> limit2)
limit2= i;


return (0);
}
 

nour2008

Member
Code:
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_width1 2
#property indicator_color1 Lime
#property indicator_width2 2
#property indicator_color2 Red
extern int qual=5;
extern int len=5;
extern int Distance = 1;
extern int Countbars=1000;
double Up[];
double Dn[];
double point;
double bs=0;
double index=0;
double bindex=0;
double sindex=0;
double length=0;
double ret=0;
int init() {
if(Digits==3 || Digits==5) {
point=10*Point;
}
else{
point=Point;
}
IndicatorBuffers(2);
SetIndexStyle(0, DRAW_ARROW);
SetIndexBuffer(0, Up);
SetIndexArrow(0,161);
SetIndexStyle(1, DRAW_ARROW);
SetIndexBuffer(1, Dn);
SetIndexArrow(1,161);

return (0);
}
int deinit() {
return (0);
}
int start() {
bool TurnedUp = false;
bool TurnedDown = false;
double highest,lowest;
int i,limit,limit2;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);

limit=Countbars-counted_bars;
if (i> limit2)
limit2= i;
if (limit2 <Countbars-1)
limit =Countbars- 1;

for( i=limit; i>=0; i--) {
if (Close[i]>Close[i+4]){
bindex=bindex+1;
}
if(Close[i]<Close[i+4]){
sindex=sindex+1;
}
ret=0;
index=0;

if ((bindex>qual) && (Close[i]<Open[i])&& (High[i]>=High[iHighest(Symbol(),0,MODE_HIGH,len,i+1)])) {
index=1;
bindex=0;
ret=-1;
}
if ((sindex>qual) && (Close[i]>Open[i])&& (Low[i]<= Low[iLowest(Symbol(),0,MODE_LOW,len,i+1)])) {
index=-1;
sindex=0;
ret=1;
}
if (ret==1 && i!=0){
Up[i]=Low[i]-Distance*point;
}
if (ret==-1 && i!=0){
Dn[i]=High[i]+Distance*point;
}
}

if (i> limit2)
limit2= i;

return (0);
}
hi all codeing experts
You must be registered for see images
can you tell me exact logic of below code . please help.


#property indicator_chart_window
#property indicator_buffers 2
#property indicator_width1 2
#property indicator_color1 Lime
#property indicator_width2 2
#property indicator_color2 Red
extern int qual=5;
extern int len=5;
extern int Distance = 1;
extern int Countbars=1000;
double Up[];
double Dn[];
double point;
double bs=0;
double index=0;
double bindex=0;
double sindex=0;
double length=0;
double ret=0;
int init() {
if(Digits==3 || Digits==5) {
point=10*Point;
}
else{
point=Point;
}
IndicatorBuffers(2);
SetIndexStyle(0, DRAW_ARROW);
SetIndexBuffer(0, Up);
SetIndexArrow(0,161);
SetIndexStyle(1, DRAW_ARROW);
SetIndexBuffer(1, Dn);
SetIndexArrow(1,161);


return (0);
}
int deinit() {
return (0);
}
int start() {
bool TurnedUp = false;
bool TurnedDown = false;
double highest,lowest;
int i,limit,limit2;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);


limit=Countbars-counted_bars;
if (i> limit2)
limit2= i;
if (limit2 <Countbars-1)
limit =Countbars- 1;


for( i=limit; i>=0; i--) {
if (Close>Close[i+4]){
bindex=bindex+1;
}
if(Close<Close[i+4]){
sindex=sindex+1;
}
ret=0;
index=0;


if ((bindex>qual) && (Close<Open)&& (High>=High[iHighest(Symbol(),0,MODE_HIGH,len,i+1)])) {
index=1;
bindex=0;
ret=-1;
}
if ((sindex>qual) && (Close>Open)&& (Low<= Low[iLowest(Symbol(),0,MODE_LOW,len,i+1)])) {
index=-1;
sindex=0;
ret=1;
}
if (ret==1 && i!=0){
Up=Low-Distance*point;
}
if (ret==-1 && i!=0){
Dn=High+Distance*point;
}
}


if (i> limit2)
limit2= i;


return (0);
}
 
one to one coaching
Top