pesavento labels on OEC plattform

Discussion in 'Retail Brokers' started by veggen, Nov 2, 2008.

  1. Tums

    Tums

    here it is:

    p.s. this is not pesavento. It only labels HH, HL, etc.

    PHP:
    inputs:  
         
    LeftStrength) ,  
         
    RightStrength), 
         
    LookBackLength100 ) ; 
     
    variable:  
         
    ID(-1), 
         
    Offset) , 
        
    HighValue1(0),
        
    HighValue2(0),
        
    LowValue1(0),
        
    LowValue2(0),
        
    Value1(0);
     
    Offset .15 AverageRange) ; 
     
    if 
    PivotHighVSBar1HighLeftStrengthRightStrengthRightStrength ) <> -1 then 
         begin 
         HighValue1 
    PivotHighVS(1HighLeftstrengthRightStrengthLookBackLength );  
         
    HighValue2 PivotHighVS(2HighLeftstrengthRightStrengthLookBackLength );  
     
         if 
    HighValue2 <> -and ( ( HighValue1 >= HighValue2 Offset ) and ( HighValue1 <= HighValue2 Offset ) ) then  
             begin 
            ID 
    Text_New(Date[RightStrength], Time[RightStrength], High[RightStrength] + Offset"DT");  
            
    Text_SetStyle(ID2) ; 
            
    Text_SetColor(IDyellow);
            
    Value1 1;
            
    end ;  
        if 
    HighValue2 <> -and HighValue1 HighValue2 and value1 0 then  
            begin 
            ID 
    Text_New(Date[RightStrength], Time[RightStrength], High[RightStrength] + Offset"HH");  
            
    Text_SetStyle(ID2) ; 
            
    Text_SetColor(IDGreen);
            
    end 
        
    else if HighValue2 <> -and HighValue1 HighValue2 and value1 0 then
            begin
            ID 
    Text_New(Date[RightStrength], Time[Rightstrength], High[RightStrength] + Offset"LH");
            
    Text_SetStyle(ID2) ;
            
    Text_SetColor(IDRed);
            
    end ;
        
    Value1 0;
        
    end 
     
    if 
    PivotLowVSBar1LowLeftStrengthRightStrengthRightStrength ) <> -1 then 
        begin 
        LowValue1 
    PivotLowVS(1LowLeftstrengthRightStrengthLookBackLength );  
        
    LowValue2 PivotLowVS(2LowLeftstrengthRightStrengthLookBackLength );  
     
        if 
    LowValue2 <> -and ( ( LowValue1 >= LowValue2 Offset ) and ( LowValue1 <= LowValue2 Offset ) ) then  
            begin 
            ID 
    Text_New(Date[RightStrength], Time[RightStrength], Low[RightStrength] - Offset"DB");  
            
    Text_SetStyle(ID2) ; 
            
    Text_SetColor(IDyellow);
            
    Value1 1;
            
    end;  
        if 
    LowValue2 <> -and LowValue1 LowValue2 and Value1 0 then  
            begin  
            ID 
    Text_New(Date[RightStrength], Time[RightStrength], Low[RightStrength] - Offset"LL");  
            
    Text_SetStyle(ID2) ; 
            
    Text_SetColor(IDRed);
            
    end 
        
    else if LowValue2 <> -and LowValue1 LowValue2 and Value1 0 then
        begin
            ID 
    Text_New(Date[RightStrength], Time[RightStrength], Low[RightStrength] - Offset"HL");
            
    Text_SetStyle(ID2) ;
            
    Text_SetColor(IDGreen);
            
    end;
        
    Value1 0;
    end 


     
    #11     Nov 5, 2008
  2. Tums

    Tums

    Pesavento pattern should look something like this:

    <img src=http://elitetrader.com/vb/attachment.php?s=&postid=2163043 width=800>
    click on attachment to enlarge
     
    #12     Nov 5, 2008
  3. veggen

    veggen

    Thanks for your reply Tums!

    I was thinking about an indicator just like the one you attached, which labels HH/HL etc! Excellent :)

    However the code did not work like it should on my OEC plattfom, i reacived error calls on some of the words when compiling it.

    I have attached a photo of them.

    Are you using OEC Tums?
     
    #13     Nov 5, 2008
  4. Tums

    Tums

    No, I am not using OEC.

    ohhhkey... about the error message... those are functions... I don't know how you can get them in OEC.

    here's the code:


    PHP:
    {Function: PivotHighVSBar}

    inputs
        
    Instancenumericsimple ), 
        
    PriceValuenumericseries ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Lennumericsimple ) ;

    variables
        
    var0), 
        
    var1) ;

    Value1 PivotPriceValueLenLeftStrengthRightStrengthInstance1var0,  var1 ) ;

    PivotHighVSBar var1 ;

    PHP:
    {Function: PivotHighVS}

    inputs
        
    Instancenumericsimple ), 
        
    PriceValuenumericseries ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Lennumericsimple ) ;

    variables
        
    var0), 
        
    var1) ;

    Value1 PivotPriceValueLenLeftStrengthRightStrengthInstance1var0,  var1 ) ;

    PivotHighVS var0 ;

    PHP:
    {Function: PivotLowVSBar}

    inputs
        
    Instancenumericsimple ), 
        
    PriceValuenumericseries ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Lennumericsimple ) ;

    variables
        
    var0), 
        
    var1) ;

    Value1 PivotPriceValueLenLeftStrengthRightStrengthInstance, -1var0,  var1 ) ;

    PivotLowVSBar var1 ;

    PHP:
    {Function: PivotLowVS}

    inputs
        
    Instancenumericsimple ), 
        
    PriceValuenumericseries ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Lennumericsimple ) ;

    variables
        
    var0), 
        
    var1) ;

    Value1 PivotPriceValueLenLeftStrengthRightStrengthInstance, -1var0,  var1 ) ;

    PivotLowVS var0 ;

     
    #14     Nov 5, 2008
  5. veggen

    veggen

    Thanks!

    I do not know how to install functions, so I sent the support-team an email, and hopefully they can guide me in the right direction in how to do this on the OEC plattform.
     
    #15     Nov 5, 2008
  6. Started to toy around with this a little. I do not think OEC will be able to plot text like TS does. You will need to go through the code and change it so it plots something. Then i would change that plot to a dot or some other point.

    As for adding functions:

    1) Hightlight Function
    2) Right click in OEC complier, select " Add Function". Make sure the name is the same name OEC is looking for.

    Going to take some time toying around with to get it work. For some reason, its doesnt like Value1 in the variables, so either just get rid of it or figure out why it doesnt like it.

    Also going to need the pivot function.

    PHP:

    inputs

        
    Pricenumericseries ), 
        
    Lengthnumericsimple ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Instancenumericsimple ), 
        
    HiLonumericsimple ), { pass in 1 for PivotHigh(Bar), -for PivotLow(Bar) }
        
    oPivotPricenumericref ), 
        
    oPivotBarnumericref ) ;

    variables
        
    CandidatePrice), 
        
    LengthCntr), 
        
    StrengthCntr), 
        
    InstanceCntr), 
        
    PivotTestfalse ), 
        
    InstanceTestfalse ) ;

    InstanceCntr ;
    InstanceTest false ;
    LengthCntr RightStrength 
    while 
    LengthCntr Length and InstanceTest false
        begin
        
    GET NEXT MOST RECENT CandidatePrice SET STARTING ASSUMPTION
          THAT IT IS A Pivot
    : }
        
    CandidatePrice Price[LengthCntr] ;
        
    PivotTest true ;
        { 
    COMPARE CandidatePrice TO LeftStrength BARS ON LEFT: }
        
    StrengthCntr LengthCntr ;
        while 
    PivotTest true and StrengthCntr LengthCntr <= LeftStrength 
            begin
            
    if ( HiLo and CandidatePrice Price[StrengthCntr] )
             or ( 
    HiLo = -and CandidatePrice Price[StrengthCntr] ) then
                PivotTest 
    false
            
    else
                
    StrengthCntr StrengthCntr ;
            
    end ;
        { IF 
    CandidatePrice SURVIVED LEFT COMPARISONNOW COMPARE TO
          RightStrength BARS ON RIGHT
    : }
        
    StrengthCntr LengthCntr ;
        while 
    PivotTest true and LengthCntr StrengthCntr <= RightStrength 
            begin
            
    if ( HiLo and CandidatePrice <= Price[StrengthCntr] )
             or ( 
    HiLo = -and CandidatePrice >= Price[StrengthCntr] ) then
                PivotTest 
    false
            
    else
                
    StrengthCntr StrengthCntr ;
            
    end ;
        { IF 
    CandidatePrice SURVIVED OVERALL AS PivotINCREMENT InstanceCntr: }
        if 
    PivotTest true then
            InstanceCntr 
    InstanceCntr ;
        { IF 
    InstanceCntr HAS REACHED REQUIRED COUNTTHEN THIS IS THE DESIRED Pivot,
          ELSE 
    INCREMENT LengthCntr TO PREPARE TO GET AND TEST NEXT CANDIDATE PRICE: }
        if 
    InstanceCntr Instance then
            InstanceTest 
    true
        
    else
            
    LengthCntr LengthCntr ;
        
    end ;
    if 
    InstanceTest true then
        begin
        oPivotPrice 
    CandidatePrice ;
        
    oPivotBar LengthCntr ExecOffset ;
        
    Pivot ; { return if required pivot found }
        
    end
    else
        
    begin
        oPivotPrice 
    = -;
        
    oPivotBar = -;
        
    Pivot = -; { return -if required pivot not found }
        
    end ;


     
    #16     Nov 5, 2008
  7. Tums

    Tums

    coming right up...

    PHP:
    {Function: Pivot}

    inputs
        
    PriceValuenumericseries ), 
        
    Lennumericsimple ), 
        
    LeftStrengthnumericsimple ), 
        
    RightStrengthnumericsimple ), 
        
    Instancenumericsimple ), 
        
    HiLonumericsimple ),                                                       
        
    oPivotPriceValuenumericref ), 
        
    oPivotBarnumericref ) ;

    variables
        
    var0), 
        
    var1), 
        
    var2), 
        
    var3), 
        
    var4false ), 
        
    var5false ) ;

    var3 ;
    var5 false ;
    var1 RightStrength 

    while 
    var1 Len and var5 false
        begin
                               
        var0 
    PriceValue[var1] ;
        
    var4 true ;
        
    var2 var1 ;

        while 
    var4 true and var2 var1 <= LeftStrength 
            begin
            condition1 
    = ( HiLo and var0 PriceValue[var2] )
             or ( 
    HiLo = -and var0 PriceValue[var2] ) ;
             
            if 
    condition1 then
                var4 
    false
            
    else
                
    var2 var2 ;
            
    end ;
                                        
        
    var2 var1 ;

        while 
    var4 true and var1 var2 <= RightStrength 
            begin
            condition1 
    = ( HiLo and var0 <= PriceValue[var2] )
             or ( 
    HiLo = -and var0 >= PriceValue[var2] ) ;
             
            if 
    condition1 then
                var4 
    false
            
    else
                
    var2 var2 ;
            
    end ;
                                                                                
        if 
    var4 true then
            var3 
    var3 ;
                                                                                     
        if 
    var3 Instance then
            var5 
    true
        
    else
            
    var1 var1 ;
        
    end ;

    if 
    var5 true then
        begin
        oPivotPriceValue 
    var0 ;
        
    oPivotBar var1 ExecOffset ;
        
    Pivot ;                                     
        
    end
    else
        
    begin
        oPivotPriceValue 
    = -;
        
    oPivotBar = -;
        
    Pivot = -;                                          
        
    end ;


     
    #17     Nov 5, 2008
  8. LOL, I already attached it.

    I was able to get it plot the text for "DT", so I guess OEC can do it. however, i tried to get all the others to work and now it wont compile, and dont really feel like working on this right now. So it can be done, just will take some time.
     
    #18     Nov 5, 2008
  9. veggen

    veggen

    well.. I spoke with the tech-support team today, and they claimed it was some sort of bug in the code. But they did not have the time to do a proper research on the code.

    They probably refered to some of the same issues Trader273 stumbled uppon.

    - If you were to work more on the code, and figure out how to solve the problem, please let me know Trader273!
     
    #19     Nov 6, 2008
  10. Toyed around with it today, but didnt get the results that it should have produced. I simply make took the condition for a double top, the way it was shown in the code in this thread, and told OEC to put a dot whenever that was true. It didnt put the dots correctly at all, so not sure what to make of it. I could have sworn when I had it "working" yesterday it was correct.

    If this is the type of stuff you want I would go two routes:

    1) Get tradestation or multicharts, and do the coding there. A lot of free scripts are out there and its relatively easy to learn.

    2) Learn C#, as that is the native coding language in OEC and other programs. Don't know how well that could be self taught, but I'm sure someone has done it before.

    I love OEC as I don't use any custom programming stuff. Just something I somewhat enjoyed toying with every now and then.
     
    #20     Nov 6, 2008