MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe) p2

#21
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

Thank you Kelvin.
I will try to read every line of code and try to understand it, this way i will learn so faster.

I pasted code and

I got output as above , i can't see timeframe there, let me increase database more and more and let's see if i get something on columns.
but this scans last bar ? even if we increase dates from Filter Range?

but first let me increase database more i only have few month database.

Haters get 100likes i don't care , but Kindly plz , trust me hate mongers just come to preach hate and laugh at there place. there're lot of ugly faces readers, who like hate comment and get code , do nothing. Kindly show your appreciation if you don't know something .
SHOW APPRECIATION TO ALL HELPER
KINDLY SHOW APPRECIATION FOR THIS GUY, HE'S SAVIOUR. WHAT HE'S DONE, PEOPLE CAN'T DO IN THEIR LIFE

WHETHER THIS CODE SAME AS UPPER PIC OR NOT, WE CAN TRY FOR IT, BUT BEFORE THIS (IMP), KINDLY SHOW APPRECIATION WHO HELPS YOU. AGAIN I SAY PEOPLE COME HERE WHEN THEY FEEL YOU , WANT TO BLESS YOU , THIS PLACE NEVER BEEN A DIRT, SOMEONE TRIED IT , AGAIN SHOW YOUR LOVE AND APPRECIATION
You are just looking for someone to code for you for free. Your attempts to code have not done much. You clearly are not able to understand the logic required.

You also dont try to understand code already posted by others. Or else you would have had the answer by now.

I can only point out that you are on the wrong path with your efforts. But if you refuse to understand that and believe that people are out to get you, then even god will not be able to help you.

Do you think that only by telling others that they cant do things would you get help from them? Or that by belittling one person would enable you to get help from another person?

Have you considered asking nicely and apologising when you are wrong? With your kind of attitude, I wonder how you do in other areas of life.

-- no1lives4ever
 
Last edited:

cheap

Active Member
#23
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

Hi,
i put this code,
LOT OF CONFUSION SOLVED THANKS again FOR YOUR CODE, LEARNT LOT OF THINGS IN JUST 1 HOUR THAN YESTERDAY 15 HOURS




In exploration in bull candle i got 1 min. but lastbar on that chart showing bear bar.
something not going right. Date not showing date.
 
Last edited:

sr114

Well-Known Member
#24
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

as u never put the date in ur code - so it is not coming


dt= Datenum ();

put this in the loop
AddRow( StrFormat( "row %g \tsecond column"+"\t"+ cls+"\t"+DateTimeToStr( dt ), i ) );


experiment with this [ the bold part ] to get the date in exploration. the code part will put the output like in image

 
Last edited:
#25
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

Hi,
i put this code,
LOT OF CONFUSION SOLVED THANKS again FOR YOUR CODE, LEARNT LOT OF THINGS IN JUST 1 HOUR THAN YESTERDAY 15 HOURS




In exploration in bull candle i got 1 min. but lastbar on that chart showing bear bar.
something not going right. Date not showing date.
Your code has some bugs. If you post the complete code, then it would be easy for us to help you debug the code.

Hint: you are getting 2 timeframes in the column for shooting star under 3 min and 2 min.

BTW.. using addrow will prevent you from double clicking on the scan and getting the active chart changed to that symbol that is coming on the scan. This is why I would preffer the method I had originally posted, which did not contain addrow.

-- no1lives4ever
 

cheap

Active Member
#26
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

as u never put the date in ur code - so it is not coming


dt= Datenum ();

put this in the loop


experiment with this [ the bold part ] to get the date in exploration. the code part will put the output like in image

Code:
Version(6.0);
SetOption("NoDefaultColumns", True );


AddTextColumn( Name(), "Ticker",1, colorDefault,colorDefault, 80);
//AddTextColumn( FullName(), "Company",1, colorDefault,colorDefault,100);
[COLOR="Red"][B]AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 );
[/B]
[/COLOR]        
AddTextColumn("#", "BullBar"); 
AddTextColumn("#", "BearBar"); 
AddTextColumn("#", "Bull Engulfing"); 
AddTextColumn("#", "Bear Engulfing"); 
AddTextColumn("$", "Shorting Star"); 


for ( i = 1; i <=15; i++ ) 
{
    TimeFrameSet( i * in1Minute );

        O1 = Ref(O,-1); 
        C1 = Ref(C,-1);
        MP = (H+L)/2;
        R = H-L;
        
        
        //-- Condition 
        
        blBar=C>MP AND O<MP;
        brBar=C<MP AND O>MP;

        blEngulf = ((O1>C1) AND (C>O) AND (C>=O1) AND (C1>=O) AND ((C-O)>(O1-C1)));
        brEngulf = ((C1>O1) AND (O>C) AND (O>=C1) AND (O1>=C) AND ((O-C)>(C1-O1)));
        
        ss = ((R>4*(O-C)) AND ((H-C)/(.001+R)>= 0.75) AND ((H-O)/(.001+R)>= 0.75));
    
            
        Filter = blBar OR brBar OR blEngulf OR brEngulf;
        
        if ( NOT LastValue(Filter) ) break;
        
        
        x= StrFormat("%02g-min", i);
        str = "";
        str = str + WriteIf(blBar,    x, "\t");
        str = str + WriteIf(brBar,    x, "\t");
        str = str + WriteIf(blEngulf, x, "\t")+
        str = str + WriteIf(brEngulf, x, "\t")+
        str = str + WriteIf(ss,       x, "");
              
               
[COLOR="red"][B]        AddRow(Name()+"\t\t\t"+str);
[/B]               
    [/COLOR]
    
    TimeFrameRestore();

     

}  

SetSortColumns(1, -2, 3,4,5,6,7);

How do you add DateTimeToStr( dt ), i ) in
AddRow(Name()+"\t\t\t"+str); ?
will it be like this below?
AddRow(Name()+DateTimeToStr( dt ), i )+"\t\t\t"+str);
i tried to add just upper one code, while dt =Datenum(); , and this
AddRow(StrFormat(Name()+DateTimeToStr( dt ), i )+"\t\t\t"+str));
it's not working

btw this AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 );
is already been presented in code.
kindly use upper AddRow(Name()+"\t\t\t"+str); example.
 
Last edited:
#27
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

Code:
Version(6.0);
SetOption("NoDefaultColumns", True );


AddTextColumn( Name(), "Ticker",1, colorDefault,colorDefault, 80);
//AddTextColumn( FullName(), "Company",1, colorDefault,colorDefault,100);
[COLOR="Red"][B]AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 );
[/B]
[/COLOR]        
AddTextColumn("#", "BullBar"); 
AddTextColumn("#", "BearBar"); 
AddTextColumn("#", "Bull Engulfing"); 
AddTextColumn("#", "Bear Engulfing"); 
AddTextColumn("$", "Shorting Star"); 


for ( i = 1; i <=15; i++ ) 
{
    TimeFrameSet( i * in1Minute );

        O1 = Ref(O,-1); 
        C1 = Ref(C,-1);
        MP = (H+L)/2;
        R = H-L;
        
        
        //-- Condition 
        
        blBar=C>MP AND O<MP;
        brBar=C<MP AND O>MP;

        blEngulf = ((O1>C1) AND (C>O) AND (C>=O1) AND (C1>=O) AND ((C-O)>(O1-C1)));
        brEngulf = ((C1>O1) AND (O>C) AND (O>=C1) AND (O1>=C) AND ((O-C)>(C1-O1)));
        
        ss = ((R>4*(O-C)) AND ((H-C)/(.001+R)>= 0.75) AND ((H-O)/(.001+R)>= 0.75));
    
            
        Filter = blBar OR brBar OR blEngulf OR brEngulf;
        
        if ( NOT LastValue(Filter) ) break;
        
        
        x= StrFormat("%02g-min", i);
        str = "";
        str = str + WriteIf(blBar,    x, "\t");
        str = str + WriteIf(brBar,    x, "\t");
        str = str + WriteIf(blEngulf, x, "\t")+
        str = str + WriteIf(brEngulf, x, "\t")+
        str = str + WriteIf(ss,       x, "");
              
               
[COLOR="red"][B]        AddRow(Name()+"\t\t\t"+str);
[/B]               
    [/COLOR]
    
    TimeFrameRestore();

     

}  

SetSortColumns(1, -2, 3,4,5,6,7);

How do you add DateTimeToStr( dt ), i ) in
AddRow(Name()+"\t\t\t"+str); ?
will it be like this below?
AddRow(Name()+DateTimeToStr( dt ), i )+"\t\t\t"+str);
i tried to add just upper one code, while dt =Datenum(); , and this
AddRow(StrFormat(Name()+DateTimeToStr( dt ), i )+"\t\t\t"+str));
it's not working

btw this AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 );
is already been presented in code.
kindly use upper AddRow(Name()+"\t\t\t"+str); example.


Getting the date is easy. sr114 has already shown how that is done.

But that is not the real problem with this code. There is a bug in your code. This bug will prevent you from getting the correct desired output.

Hint: it has to do with the addrow function and the parameters that are passed to the function. You need to go back and see how each parameter is set and what happens under various scenarios.

Hint2: Your output screenshot from a previous post showed a timeframe twice under a column, understanding why that happens and then fixing that will most likely help fix the bug for you.

Once again let me reiterate, you are trying to randomly add code. This will not lead you to a proper working program. Spend a little bit of time to understand how program flow works, how things like variables, conditional statements and loops work.

What you are trying to do is similar to opening a word document with some text in foreign language that you dont understand and then randomly copy/pasting stuff from forum posts to get a paragraph that makes sense. If you try this, you know that in most cases you will end up with something that makes no sense.

-- no1lives4ever
 

sr114

Well-Known Member
#28
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

Getting the date is easy. sr114 has already shown how that is done.

But that is not the real problem with this code. There is a bug in your code. This bug will prevent you from getting the correct desired output.

Hint2: Your output screenshot from a previous post showed a timeframe twice under a column, understanding why that happens and then fixing that will most likely help fix the bug for you.

-- no1lives4ever
This is the code of Kelvin. the bug is here
Code:
Version(6.0);
SetOption("NoDefaultColumns", True );
AddTextColumn( Name(), "Ticker",1, colorDefault,colorDefault, 80);
AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 ); [ its col in the row to hold the date val]

AddTextColumn("#", "BullBar"); 
AddTextColumn("#", "BearBar"); 
AddTextColumn("#", "Bull Engulfing"); 
AddTextColumn("#", "Bear Engulfing"); 
AddTextColumn("$", "Shorting Star"); 

for ( i = 1; i <=15; i++ ) 
{
    TimeFrameSet( i * in1Minute );

        O1 = Ref(O,-1); 
        C1 = Ref(C,-1);
        MP = (H+L)/2;
        R = H-L;
        
        blBar=C>MP AND O<MP;
        brBar=C<MP AND O>MP;

        blEngulf = ((O1>C1) AND (C>O) AND (C>=O1) AND (C1>=O) AND ((C-O)>(O1-C1)));
        brEngulf = ((C1>O1) AND (O>C) AND (O>=C1) AND (O1>=C) AND ((O-C)>(C1-O1)));
        
        ss = ((R>4*(O-C)) AND ((H-C)/(.001+R)>= 0.75) AND ((H-O)/(.001+R)>= 0.75));
 
        Filter = blBar OR brBar OR blEngulf OR brEngulf;
        if ( NOT LastValue(Filter) ) break;
        
        x= StrFormat("%02g-min", i);
        str = "";
        str = str + WriteIf(blBar,    x, "\t");
        str = str + WriteIf(brBar,    x, "\t");
        str = str + WriteIf(blEngulf, x, "\t")+  the bug is here
        str = str + WriteIf(brEngulf, x, "\t")+  the bug is here
        str = str + WriteIf(ss,       x, "");
                     
        AddRow(Name()+"\t\t\t"+str);

    TimeFrameRestore();
}  

SetSortColumns(1, -2, 3,4,5,6,7);
also the Addcolumn and Addtextcolumn are the container to hold the values - the name and date portion as will be depicted by addrow. so to get the proper addrow output we have to out proper code , otherwise it will never come out

cheap, lastly try to understand the code - read it multiple times , see the example and then try - or u will never get a workable code
 

cheap

Active Member
#29
Re: MTF timeframe scan output (Scanning Timeframe not Pattern with single timeframe)

hi,
Code:
Version(6.0);
SetOption("NoDefaultColumns", True );
AddTextColumn( Name(), "Ticker",1, colorDefault,colorDefault, 80);
[B][COLOR="Red"]AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 ); 
//[ its col in the row to hold the date val]
[/COLOR][/B]
AddTextColumn("#", "BullBar"); 
AddTextColumn("#", "BearBar"); 
AddTextColumn("#", "Bull Engulfing"); 
AddTextColumn("#", "Bear Engulfing"); 
AddTextColumn("$", "Shorting Star"); 

for ( i = 1; i <=15; i++ ) 
{
    TimeFrameSet( i * in1Minute );

        O1 = Ref(O,-1); 
        C1 = Ref(C,-1);
        MP = (H+L)/2;
        R = H-L;
        
        blBar=C>MP AND O<MP;
        brBar=C<MP AND O>MP;

        blEngulf = ((O1>C1) AND (C>O) AND (C>=O1) AND (C1>=O) AND ((C-O)>(O1-C1)));
        brEngulf = ((C1>O1) AND (O>C) AND (O>=C1) AND (O1>=C) AND ((O-C)>(C1-O1)));
        
        ss = ((R>4*(O-C)) AND ((H-C)/(.001+R)>= 0.75) AND ((H-O)/(.001+R)>= 0.75));
 
        Filter = blBar OR brBar OR blEngulf OR brEngulf;
        if ( NOT LastValue(Filter) ) break;
        
        x= StrFormat("%02g-min", i);
        str = "";
        str = str + WriteIf(blBar,    x, "\t");
        str = str + WriteIf(brBar,    x, "\t");
       [COLOR="red"] str = str + WriteIf(blEngulf, x, "\t");  //removed + sign ,the bug is here
        str = str + WriteIf(brEngulf, x, "\t");  //removed + sign ,the bug is here[/COLOR]
        str = str + WriteIf(ss,       x, "");
                     
        AddRow(Name()+"\t\t\t"+str);

    TimeFrameRestore();
}  

SetSortColumns(1, -2, 3,4,5,6,7);


I've removed plus sign. it's showing red color candle still in place of 1 min. in Bulleng whether i get date time or not?
for Addrow
i.e.

AddRow( StrFormat( "row %g \tsecond column"+"\t"+ cls+"\t"+DateTimeToStr( dt ), i ) );
to
AddRow(Name()+"\t\t\t"+str);


Do i need to add Strformat in addrow() with DateTime()? i need to play with DateTimeToStr( dt ), i ) ?
/t used for moving vertical column from one column to another.
if i put dt= Datenum (); and DateTimeToStr( dt ), i ) in AddRow(Name()+"\t\t\t"+str); it's not working as it worked in example of row%g ones.
As you said,
AddColumn( DateTime() , "Date", formatDateTime, colorDefault,colorDefault, 80 ); [ its col in the row to hold the date val]
does it work as array or Do we need to remove Addcolumn(); ?
 
Last edited:

Similar threads