Hi,
could  someone check this Strategy + priority for me? I think something is wrong. I always get as prio 98 at long and fo Short 2.
Thanks.
CODE:
Please log in to see this code.
     
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi,
Because you've coded it this way. Your DataSeries behind the Priority take only a few integer values ranging from -2 to +2. Most of the time they are at -2.
CODE:
Please log in to see this code.
Actually, it would be beneficial to you to learn how to debug scripts using PrintDebug and plotting statements. 
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi Eugene,
QUOTE:
Actually, it would be beneficial to you to learn how to debug scripts using PrintDebug and plotting statements
do you know any examples to understand it better how to debug scripts?
What do you think, makes this strategy sense without a priority? and did you find any mistakes in coding?
Thanks in advance.
greetings Damir
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi Damir,
QUOTE:
do you know any examples to understand it better how to debug scripts?
1. Look up PrintDebug in the QuickRef (F11 key). FlushDebug and ClearDebug make it more flexible.
2. Type in "debug" in forum's search box.
3. You can also use methods like AnnotateBar to attach some printout to a bar in a more visual way than PrintDebug but it's limited by screen space.
I deliberately didn't suggest this article as it requires Visual Studio IDE skills: 
How can I debug my trading strategies in Wealth-Lab?. But it's the best one can have when it comes to debugging with its powerful features such as 
breakpoints, 
Edit and Continue and 
DataTips.
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi Eugene,
I will try it and thank you for your help
greetings damir
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi,
CODE:
Please log in to see this code.
For my understanding. Can someone explain me what this exactly does. I have not found an explanation for DataSeries.Abs.
Thanks in advance.
greetings Damir
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        QUOTE:
I have not found an explanation for DataSeries.Abs
It naturally can be found in the QuickRef (F11 key), explained under 
DataSeries chapter with an example.
And /= in WealthScript (C#) divides the DataSeries by another DataSeries (or a value) and assigns the result to the divisible.
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi Eugene,
thank you. 
greetings Damir
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi,
i did try to calculate the priority step by step, but i'm stucking with the sum.series. 
Can anyone explain me that, please. 
CODE:
Please log in to see this code.
for example: 
Sum.Series(9, 2)
QUOTE:
Calculation: Sum = ( D1 + D2 + ... + Dn )
D = DataSeries to be summated, Bars.Open, Bars.Close, TrueRange.Series, SMA.Series, etc..
Results: 9 + 2 = ?
I don't know what kind of Closes? RSI.Series.Closes?
greetings damir
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        QUOTE:
I don't know what kind of Closes? RSI.Series.Closes?
What you passed to the Sum series, of course. In particular, the "diff" series from the code you 
borrowed earlier. There's nothing to add to what you're already quoting - the 
Sum documentation. It's all explained there.
Damir, let's go the other way around.  What do you want the Priority to be here, in plain English?
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Hi Eugene,
QUOTE:
Damir, let's go the other way around. What do you want the Priority to be here, in plain English?
because, if i have a pos.Size of 20% and get 7 signals. Then i like take the best 5 Signals with the highest priority. 
For example: RSI Range 0 -100; 
1 Signal: 99,59
2 Signal: 99,49
and so on.
This is the reason why i'm confused with only 98, but this is not a drama.
greetings damir
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Damir, sorry if I wasn't clear. The question was not "why" (the priority) but rather "what" (priority value algorithm). So, summated are the "diff" values (based on RSI in its turn) over the lookback period ("slider5.ValueInt").
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Eugene, i'm not sure if i can follow you. 
QUOTE:
So, summated are the "diff" values (based on RSI in its turn) over the lookback period ("slider5.ValueInt"). 
PriorityLong = 100 - diff
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        I was talking about this logic:
CODE:
Please log in to see this code.
     
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        this is part of the strategy.
in my case. 
CODE:
Please log in to see this code.
     
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        OK. Is there anything left not clear regarding Sum.Series etc.?
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Yes. 9 and 2 are the Values but not the result (calculation) of the Sum.Series. Ist that correct?
What is here D1 + D2 and Dn? Is D1 = 9? and Dn = 2?
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        QUOTE:
DataSeries diff = 11 - RSI-calculation with Lookback 2;
Right. 11 - RSI(2) value.
QUOTE:
diff /= |diff|; 
Correct.
QUOTE:
diff = Sum.Series( 9, 2);
D1 would be a 9 only when the RSI value is 2.0 on a given bar (11 - 9). The Sum period is 2 days, that's correct.
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        QUOTE:
D1 would be a 9 only when the RSI value is 2.0 on a given bar (11 - 9). The Sum period is 2 days, that's correct.
Okay. I think i got it. The SumSeries do only summarize periods or bars.Is that correct? That's the reason why i am always getting a priority of 98 (100-2 = 98). 
I checked this in my strategy. I have change the slider5 from to 2 to 3 and the result was 97 (100-3 = 97).
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        QUOTE:
The SumSeries do only summarize periods or bars.
It sums values from the specified DataSeries over the desired period. That's it.
    
 
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Eugene, thank you for your help and patience. 
greetings damir
    
    
        
    
    
        
    
    
        Size:  
    
        Color:  
    
    
 
    
        
     
    
        
    
 
    
    
    
        Damir, you're welcome.
    
    
        
    
    
        
    
    
        Size:  
    
        Color: