Debugging
-
I am not able to debug a piece of code of KeltnerChannels ea.
Block 243 never get false i.e. the only way to activate block 1408 is from block 685 setting to 0 the golong costant.
the rest of the ea opening and closing deals in the right position works correctly, but I am not able to understand what I am doing wrong.
Can you please help me?
Thx
-
It's block 343 I guess. So the condition inside is not working. Are you sure you want to work with Candle Open? And maybe try with the block named "Price x< Indicator", if this is the idea.
x< in Condition block works a little bit... it depends. In your case it compares Candle Open vs Indicator for the current candle, and also for the previous candle.
Try this condition alone.
-
__It's block 343 I guess. So the condition inside is not working. Are you sure you want to work with Candle Open? And maybe try with the block named "Price x< Indicator", if this is the idea.
x< in Condition block works a little bit... it depends. In your case it compares Candle Open vs Indicator for the current candle, and also for the previous candle.
Try this condition alone.[/quote:pwvxfhkz]
ok I'll try. To me candle1 close and candle open0 are almost the same when you work onceperbar. anyway we will see
-
____It's block 343 I guess. So the condition inside is not working. Are you sure you want to work with Candle Open? And maybe try with the block named "Price x< Indicator", if this is the idea.
x< in Condition block works a little bit... it depends. In your case it compares Candle Open vs Indicator for the current candle, and also for the previous candle.
Try this condition alone.[/quote:1c546244]
ok I'll try. To me candle1 close and candle open0 are almost the same when you work onceperbar. anyway we will see[/quote:1c546244]
Yes you were right the >X and the opposite operator works randomly. Its a pitty: that operator keep the program structure much more easier to be read.
thx
-
Randomly...
This is how I made it initially, and it's the same way today. If you cross MA5 and MA20 with x>, the conditions are these:MA5[0] > MA20[0] and MA5[1] < MA20[1]
where 0 and 1 are candle id's.
This works for indicators, because each indicator has 1 value per candle. It becomes a little bit weird when candle data is used:Close[0] > MA[0] and Close[1] < MA[1]
Here it will be more correct if Close[1] is Open[0] instead. But in "Condition" is not. That's why I created 2 more blocks for price crossovers, which work in a little bit different way - they detect when the price crosses some value, but using data from the current tick and the previous tick.