Code snippets - page 6

 
mladen:
AZRUL The easiest way would be to add one more buffer to that indicator and count the arrows in that buffer

Dear SIR MLADEN,

Thanks you SIR for the tip... the thing is I have NO idea how to do that and (if) to clear the counting when there is a 2nd conservative same signal....

I will try to search more on the NET....

yours truly

AZRUL...

 
12BPRO:
Dear SIR MLADEN,

Thanks you SIR for the tip... the thing is I have NO idea how to do that and (if) to clear the counting when there is a 2nd conservative same signal....

I will try to search more on the NET....

yours truly

AZRUL...

Can you post that indicator?

 
mladen:
Can you post that indicator?

Dear SIR MLADEN,

I LOVE to post this indicator at your request SIR.... but it is still under work in progress....

still not functioning as expected.... just want to see how it works, not tested yet...

I would not want to let you down SIR.. let me try to make it reliable first...

after that I am ready get some feedback... (now I am just making a fool of myself )

yours truly

AZRUL...

 
mladen:
Can you post that indicator?

Dear SIR MLADEN,

This the full signal from the indicator... compare to the previous one...

I am trying to cancel out a few arrow signal... it is to messy...

I could PM you the whole thing... as my RESPECT to you my GURU...

yours truly

AZRUL...

Files:
2_signal.jpg  236 kb
 
12BPRO:
Dear SIR MLADEN,

This the full signal from the indicator... compare to the previous one...

I am trying to cancel out a few arrow signal... it is to messy...

I could PM you the whole thing... as my RESPECT to you my GURU...

yours truly

AZRUL...

Do the following:

Make a buffer called count

when the arrow appears you :

a) set the value of count to 1 or -1 (depending on the arrow type) if the previous count value had a different sign

b) add 1 to previous count value if the signs are the same

Then if count == 2 and count != 2 or count == -2 and count != -2 you have a signal to enter

 
mladen:
Do the following:

Make a buffer called count

when the arrow appears you :

a) set the value of count to 1 or -1 (depending on the arrow type) if the previous count value had a different sign

b) add 1 to previous count value if the signs are the same

Then if count == 2 and count != 2 or count == -2 and count != -2 you have a signal to enter

Dear SIR MLADEN,

This was my previous codes

for( i=limit-1; i>=0;i--)

{

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

//Print(mtf);

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

if(aud > usd)

BufBuy = Close;

//drawArrow("#MTD_CCIArrow",1,20,Open);

if(aud < usd)

BufSell = Open;

//drawArrow("#MTD_CCIArrow",-1,20,i);

}

[/PHP]

I have made the following.........

1) 2 buffer count.....

2) set the value of count to 1 or -1 (depending on the arrow type) if the previous count value had a different sign

[PHP]

for( i=limit-1; i>=0;i--)

{

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

if(aud > usd)

countB = countB + 1;

countS = 0;

if(aud < usd)

countS = countS - 1;

countS = 0;

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

if (countB >= 2 && countB != 2 )

BufBuy = Close;

//drawArrow("#MTD_CCIArrow",1,20,Open);

if(countS <= -2 && countS != -2)

BufSell = Open;

//drawArrow("#MTD_CCIArrow",-1,20,i);

}

3) add 1 to previous count value if the signs are the same ???

This one I am not sure how to do this....???and it would sum up more then 2......

SORRY I am lost right now....

yours truly

AZRUL...

 
12BPRO:
Dear SIR MLADEN,

This was my previous codes

for( i=limit-1; i>=0;i--)

{

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

//Print(mtf);

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

if(aud > usd)

BufBuy = Close;

//drawArrow("#MTD_CCIArrow",1,20,Open);

if(aud < usd)

BufSell = Open;

//drawArrow("#MTD_CCIArrow",-1,20,i);

}

[/PHP]

I have made the following.........

1) 2 buffer count.....

2) set the value of count to 1 or -1 (depending on the arrow type) if the previous count value had a different sign

for( i=limit-1; i>=0;i--)

{

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

if(aud > usd)

countB = countB + 1;

countS = 0;

if(aud < usd)

countS = countS - 1;

countS = 0;

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

if (countB >= 2 && countB != 2 )

BufBuy = Close;

//drawArrow("#MTD_CCIArrow",1,20,Open);

if(countS <= -2 && countS != -2)

BufSell = Open;

//drawArrow("#MTD_CCIArrow",-1,20,i);

}

3) add 1 to previous count value if the signs are the same ???

This one I am not sure how to do this....???and it would sum up more then 2......

SORRY I am lost right now....

yours truly

AZRUL...

Do like this :

[PHP]

if (i==Bars-1) { count=0; continue; }

count = count;

if(aud > usd){ if count <=0; count = 1; else; count +=1; }

if(aud =0; count = -1; else; count -=1; }

And then you can compare count with count; If count==2 or -2 and count==1 or -1 then you have a signal

 
mladen:
Do like this :

if (i==Bars-1) { count=0; continue; }

count = count;

if(aud > usd){ if count <=0; count = 1; else; count +=1; }

if(aud =0; count = -1; else; count -=1; }

[/PHP]

And then you can compare count with count; If count==2 or -2 and count==1 or -1 then you have a signal

Dear SIR MLADEN,

I patched the code as follows.....

[PHP]

for( i=limit-1; i>=0;i--)

{

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

if (i==Bars-1) { count=0; continue; }

count = count;

if(aud > usd )

{if (count <=0) count = 1; else count +=1;}

if(aud < usd)

{if (count >=0) count = -1; else count -=1;}

if (count == 2 && count != 2)

BufBuy = Close;

if (count == -2 && count != -2)

BufSell = Open;

}

Is this correct to edit the code this way... still NO signal (arrow)....

yours truly

AZRUL...

 
12BPRO:
Dear SIR MLADEN,

I patched the code as follows.....

for( i=limit-1; i>=0;i--)

{

BufBuy = EMPTY_VALUE;

BufSell = EMPTY_VALUE;

double aud = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair1,i);

double usd = iCustom(Symbol(),0,"#ConsoleFU-TOT-testGV",Pair2,i);

if (i==Bars-1) { count=0; continue; }

count = count;

if(aud > usd )

{if (count <=0) count = 1; else count +=1;}

if(aud < usd)

{if (count >=0) count = -1; else count -=1;}

if (count == 2 && count != 2)

BufBuy = Close;

if (count == -2 && count != -2)

BufSell = Open;

}

Is this correct to edit the code this way... still NO signal (arrow)....

yours truly

AZRUL...

Check the for( i=limit-1; i>=0;i--) part and check what are the return values from the iCustom() call

 
mladen:
Check the for( i=limit-1; i>=0;i--) part and check what are the return values from the iCustom() call

Dear SIR MLADEN,

I don't know what is wrong with this count thing... it simply not working

This is a picture of the arrow signal

And this is the edited code to cancel the same arrow signal,

I have check the iCustom CALL and it has a value... 2nd line

But the count buffer has NO value (0) Zero....

yours truly

AZRUL...

PS- got to get some sleep.... my head is boiling....

Thank you SIR for the time and attention you have given.... hope some day could return the favor....

Files:
capture2.jpg  50 kb
capture_1.jpg  65 kb
Reason: