# PI Coding Help Required in Strategy

Hi All,

I am trying to code the following in the PI, But i am getting error as “No trades generated for the script”

I tried the same using Excel and its working fine in Excel.

Can someone help me in getting this code up and running???

#Code

SET HP= (1 - 0.123 / 2)(CLOSE - REF(CLOSE,1)) + (1 - 0.123 )REF(HP,1)
SET FILT = 0.253
(HP + REF(HP,1)) / 2 + 1.158
REF(FILT,1) + (-0.411)REF(FILT,2)
SET PRICE1 = CLOSE + FILT
SET VALUE111 = 0.33
2*((PRICE1 - MIN(PRICE1,10))/(MAX(PRICE1,10) - MIN(PRICE1,10)) - .5) + .67REF(VALUE111,1)
SET VALUE11 = IF(VALUE111>0.99,0.999,VALUE111)
SET VALUE1 = IF(VALUE11<-0.99,-0.999,VALUE11)
SET FISH = 0.5
LOG10((1 + VALUE1)/(1 - VALUE1)) + .5*REF(FISH,1)
FISH>REF(FISH,1)

#SELL
SET HP= (1 - 0.123 / 2)(CLOSE - REF(CLOSE,1)) + (1 - 0.123 )REF(HP,1)
SET FILT = 0.253
(HP + REF(HP,1)) / 2 + 1.158
REF(FILT,1) + (-0.411)REF(FILT,2)
SET PRICE1 = CLOSE + FILT
SET VALUE111 = 0.33
2*((PRICE1 - MIN(PRICE1,10))/(MAX(PRICE1,10) - MIN(PRICE1,10)) - .5) + .67REF(VALUE111,1)
SET VALUE11 = IF(VALUE111>0.99,0.999,VALUE111)
SET VALUE1 = IF(VALUE11<-0.99,-0.999,VALUE11)
SET FISH = 0.5
LOG10((1 + VALUE1)/(1 - VALUE1)) + .5*REF(FISH,1)
FISH<REF(FISH,1)

The above script has no error and no trades also.. i am check for different scripts.. Can you post conditions / vector logic for this..

Thanks for looking into it…
I tried using the same PI data used for testing in excel and in excel for the same data i am getting both buy and sell signals… whereas PI backtest tell me no trades for the given script… so its strange…
Can you share your eamil id so that i can send the excel file used to test this code? or how can i attach the excel here?