Hi,
I have started using version 11.1 (thanks to Ale mentioning to me) on IG Demo account. I am migrating my code from production 10.3v to demo account so that when 11.1 goes to live on IG, i shall be able to take advantage of it.
I’ve been able to import all of my indicators without any issue.
All indicators are working except one. The code is OK, there is no error, it works fine on 10.3 but somehow not showing results on 11.1 while same shows results on 10.3 on same time frame and instrument (stock/index).
There is no error in the code. It saves and gets added without any syntax error. What could be the issue?
Difficult to know exactly why without the code.
But try to embed your indicator’s code into a test about sufficient barindex. If your indicator is using periods, use the biggest one in the test:
if barindex > biggestPeriod then
//your indicator code
endif
RETURN var1, var2 //return line is outside the test
Hi,
I am using e.g.
DEFPARAM CalculateOnLastBars = 1000
hEst = highest[highLen](close)
lEst = lowest[lowLen](close)
where highLen and lowLen are passed as input variables (e.g. highLen=5 and lowLen=5)
I will try adding yours also.
I did like below:
DEFPARAM CalculateOnLastBars = 1000
alpha = 255
longConditions = 0
shortConditions = 0
r= 75//75
g= 75//75
b= 75//75
if barindex > 1000 then
<rest of my code here>
endif
return myvar1, myvar2
No errors but no results.
Please use the button to insert code into your message.
The code is working ok for me, see attached picture.
Thanks Nicola for your quick responses. I will go to old (my rubbish) way of debugging the code i.e. add lines one by one and see the reaction.
Hi,
I found the issue. I will highlight here as it would be useful to others.
PRT 10.3v
=======
// e.g. for dax
myValue = 13033
Condition1 = 1
Condition2 = 1
if (close[1] = myValue AND Condition1 AND Condition2) then
<do something>
endif
// Above myValue AND Condition1 AND Condition2 meant 13033
PRT 11
=====
// e.g. for dax
myValue = 13033
Condition1 = 1
Condition2 = 1
if (close[1] = myValue AND Condition1 AND Condition2) then
<do something>
endif
// Above myValue AND Condition1 AND Condition2 meant 1
So I did like this then
// e.g. for dax
myValue = 13033
Condition1 = 1
Condition2 = 1
if (Condition1 AND Condition2) then
if (close[1] = myValue) then
<do something>
endif
endif
// Above myValue AND Condition1 AND Condition2 meant 13033
Sorry I don’t get it, in any case, this code:
(close[1] = myValue AND Condition1 AND Condition2)
is a boolean expression and will return 0 (false) or 1 (true).
Yes that is a boolean expression but condition wasn’t getting true in v11 as shown in above example. So I modified code in v11 as stated above.