fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Debugging

    Questions & Answers
    2
    5
    867
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NonciAzzecco last edited by

      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

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • N
          NonciAzzecco last edited by

          __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

          1 Reply Last reply Reply Quote 0
          • N
            NonciAzzecco last edited by

            ____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

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              Online Users

              Z
              O
              R
              A

              7
              Online

              146.8k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors