Results from the strategy and the indicators match perfectly.
Results from the strategy and the indicators match perfectly.
well, I’m sure it works well, the code is good. Why doesn’t work on my Prorealtime?
I have changed instrument and time
What do you mean by changed time? Roberto is suggesting that you are using custom trading hours where candles are missing from your chart but are still used in indicator calculation If you have just switched to a different time frame then this is not what he meant.
If you see the attached pictures you see that I’m not speaking of TF..
Right click on your chart window and check what did you set as custom market hours. If you had changed it, set back to default, and display the weekend data too.
@pieroim
before going ahead posting always the same question, read carefully all posts and answer my question, please! (actually there was no question mark!!!)
I wrote “from Sept. 20th through Sept. 24th you only see 3 candlesticks, while there are 4, tallying sunday“, where does this difference come from ?
Hi Nicolas,
I never have changed the the configuration, I have installed the v11 from 5 days and I have changed nothing in the configuration, it is all at the default, it is a new installation with only active Future live data of CME. Prorealtime data. Nothing else.
Roberto, I have changed the financial instrument to EURUSD (only days because I not have the real time data of it in my package) only to facilitate you to find the problem.. and I find the problem in a wrong calc when the backtest is applied, and ONLY in BACKTEST.
I insert again, I also entered it yesterday, the default configuration on EURUSD .. as you can see nothing has been changed.
Plese, SEE IT.
I have no idea about the behaviour on v11, since I am not using it.
Maybe Nicolas will be of greater help.
Did you try with a “defparam preloadbars=0” at the top of the strategy code?
defparam preloadbars=0”
It does not work..
Defparam preloadbars=0
Defparam cumulateorders=false
if Barindex < 2 then
BU = Close
else
BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
endif
if barindex>PP then
Signal = BU
Noise = Close
SigmaSignal = STD[PP](Signal)
SigmaNoise = STD[PP](Noise)
a = SigmaSignal/SigmaNoise
n = (2/a)-1
if n < 1 then
nn = 1
else
nn = n
endif
MB = ExponentialAverage[nn](Close)
endif
cl=(MB>BU)
cs=(MB<BU)
GRAPH MB coloured (0,0,255) as "cl"
GRAPH BU coloured (255,0,0) as "cs"
if NOT LongOnMarket AND cl THEN
BUY 1 CONTRACTS AT MARKET
endif
if NOT ShortOnMarket AND cs THEN
SELLSHORT 1 CONTRACTS AT MARKET
endif
Ok, you are right, the problem comes with the exponentialaverage instruction, it doesn’t compute correctly. I will make a technical report, please do it also with a link to this thread.
In the meantime, I coded the EMA with its formula and it works now correctly:
Defparam preloadbars=0
Defparam cumulateorders=false
pp=17
if Barindex < 2 then
BU = Close
else
BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
endif
if barindex>PP then
Signal = BU
Noise = Close
SigmaSignal = STD[PP](Signal)
SigmaNoise = STD[PP](Noise)
a = SigmaSignal/SigmaNoise
n = (2/a)-1
if n < 1 then
nn = 1
else
nn = n
endif
//MB = ExponentialAverage[nn](Close)
EMALength = nn
alpha = 2/(EMALength+1)
CustomEMA = alpha*Close + (1-alpha)*CustomEMA[1]
MB=CustomEMA
endif
cl=(MB>BU)
cs=(MB<BU)
if NOT LongOnMarket AND cl THEN
BUY 1 CONTRACTS AT MARKET
endif
if NOT ShortOnMarket AND cs THEN
SELLSHORT 1 CONTRACTS AT MARKET
endif
GRAPH MB coloured (0,0,255) as "cl"
GRAPH BU coloured (255,0,0) as "cs"
//graph n
Great Nicolas! Ok, I’ll send it.
Hi Nicolas,
I think there’s still something wrong … see the pictures: mini Nasdaq100 full1219
I have the same, identical problem with eurusd..
Defparam preloadbars=0
Defparam cumulateorders=false
pp=17
if Barindex < 2 then
BU = Close
else
BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
endif
if barindex>PP then
Signal = BU
Noise = Close
SigmaSignal = STD[PP](Signal)
SigmaNoise = STD[PP](Noise)
a = SigmaSignal/SigmaNoise
n = (2/a)-1
if n < 1 then
nn = 1
else
nn = n
endif
//MB = ExponentialAverage[nn](Close)
EMALength = nn
alpha = 2/(EMALength+1)
CustomEMA = alpha*Close + (1-alpha)*CustomEMA[1]
MB=CustomEMA
endif
cl=(MB>BU)
cs=(MB<BU)
if NOT LongOnMarket AND cl THEN
BUY 1 CONTRACTS AT MARKET
endif
if NOT ShortOnMarket AND cs THEN
SELLSHORT 1 CONTRACTS AT MARKET
endif
GRAPH MB coloured (0,0,255) as "cl"
GRAPH BU coloured (255,0,0) as "cs"
Yes because the code wait for 17 bars to begin the calculation. So you should also include the trading instructions in the same IF/ENDIF block (move line 31 to 44).
Thank’s Nicolas..
I’ll do some tests in the afternoon and I’ll let you know.
Meanwhile, I sent a ticket to technical support to report the problem .. but instead of focusing on the problem, they sent me an email telling me that I am an IG customer and therefore it is not their responsibility to solve the problem .. BHA!
Anyway, I answered earlier that version 10 was with IG, an account that had been abandoned for about 2 years, while v11 was not!
We hope that this time they will focus more on the probable bug in v11 than on bureaucratic issues that are of little interest to traders.
However I have indicated the link to this discussion .. I hope they come to read it ..
Seems normal that a company don’t supply support for someone who is not their customer? 😉