Example of strategy below
timeframe (4 hour)
indicator1 = ADX[15]
indicator2 = ADXR[20]
entrycond1 = (indicator1[1] > indicator2[1])
timeframe ( default)
indicator3 = ADX[10]
indicator4 = ADXR[14]
entrycond2 = (indicator3[1] > indicator4[2])
If entrycond1 and entrycond2 then
buy 1 contract at market
If I would split it into indicator and strategy without the MTF I know that it would just be done like below:
indicator:
indicator1 = ADX[15]
indicator2 = ADXR[20]
entrycond1 = (indicator1[1] > indicator2[1])
indicator3 = ADX[10]
indicator4 = ADXR[14]
entrycond2 = (indicator1[3] > indicator2[4])
return entrycond1, entrycond2
strategy:
entrycond1, entrycond2 = CALL “indicator”
if entrycond1 and entrycond2 then
buy 1 contract at market.
Above is just wihtout MTF but why is it not with MTF same with indicator and on strategy file
Timeframe (4 hour)
entrycond1 = call “indicator”
timeframe (default)
entrycond2 = call “indicator”
if entrycond1 and entrycond2 then
buy 1 contract at market.
Why is it not working like above, and what am I doing wrong?
Can you post a screenshot with the mouse sitting on a bar whose dataare visible?
Do you always use a 4h TF for both the split indicator+strategy?
I think I got missunderstood.
The strategy above is just random, I dont even know if it does work. I just want to know how to CALL for a indicator when using MTF.
indicator1 = random1
indicator2 = random2
entrycond1 = (random1 > random2])
indicator3 = random3
indicator4 = random4
entrycond2 = (random3 > random4)
return entrycond1, entrycond2
timeframe (4 hours)
entrycond1 = CALL "indicator"
timeframe (default)
entrycond2 = CALL "indicator"
if entrycond1 and entrycond2 then
buy 1 contract at market
endif
Why does it not work like this? How should I be doing it to make it work? I do not use this code above I am just talking in general. What am I doing wrong with the CALL on MTF.
Because when I do call like this (wiht my other strategies) I get this message “the function “indicator” called from “strategy” returns 21 values but your codes needs 2. I can not understand what I am doing wrong..
Attached pictures of what I mean.. What am I doing wrong here?
The indicator returns 2 values, so you need to use 2 variables when using CALL.
thanked this post
Thanks alot!
Can you explain this (attached photo)?
The indicator RETURNs 3 data so you need to use 3 variables when CALLing it.
Ofcourse I did wrong in the example. But even with 3 data and 3 varialbes on calling it, it somehows give different result. It works to backtest but the result differ when its 3 different timesframes (it does not work correctly)
Post the complete code and details about issues, date and time of candles with wrong data, instrument and default TF used, so I can get the same results.
thanked this post
I solved it. Thanks anyway Roberto, you are a good man. Helping people like this!