fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. MrDaisyBates
    3. Best
    • Profile
    • Following 3
    • Followers 0
    • Topics 17
    • Posts 126
    • Best 26
    • Controversial 1
    • Groups 0

    Best posts made by MrDaisyBates

    • RE: "Run Blocks" Block

      Thanks both of you! ❤

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • RE: Trailing Limit/Stop

      @Mr-Hdrn There's probably better answers, but if you're only doing it once per candle, you could always consider deleting the order and placing a new one.

      In the "Loop for Positions and Orders" category. There's a block called "Slide Order." I've never used it, but if you can figure it out, it should accomplish what you're looking for, I believe.

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • RE: First Attempt at Arrays. Could use an expert opinion.

      Ah! @roar You're an absolute legend! So much appreciation here.

      I didn't realize arrays could be declared in the normal variable area (and actually NEED to be declared there!) It's actually embarrassing that it's THAT simple. I wish I'd seen it in the documentation. I know it's an advanced feature, but still. For completeness sake. Arrays are so important for so many projects it seems.

      It's also really validating to see that I was actually doing it all very right on my end apart from a simple typo! Thanks also for the tip to export the source and debug it in metaeditor directly. I'll def need to keep it in mind. I've got a really big project underway and I might end up needing it.

      For the condition block that I have to type in myself, like you suggested, I suppose I'd simply add "== true"?

      Is it sensitive to spaces? Do the spaces need to be there or is math/statements fine without spaces in this case?

      Hahahaha. Your meme. ❤

      I did have a question about arrays above that I'd kinda like an answer to if possible.

      I'm using undeclared size arrays here.

      If I have an unknown amount of "things." Like "bear candles" in this case. Do I need to count all of them first, THEN size the array to that size, before I can store stuff in the array? Or is it okay for me to somehow add items to the array and adjust it as necessary? Will it break the array somehow or do they tolerate being able to just add to it and expand it as necessary? Would I simply just resize it +1 first and then add whatever value it is to the new slot? I hope that's kinda clear what I'm asking. Sorry it's not more direct.

      On a similar point, if something, say, in the "middle" of an array becomes invalid and I no longer need it, is there a way to remove it (simply), or is it better to set the index to "zero" and just filter it that way, or is it better to just repopulate the entire array again in that case?

      Thanks again, Roar. ❤

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • RE: First Attempt at Arrays. Could use an expert opinion.

      @roar This "Print()" tip is super handy! Thanks for sharing it.

      I noticed I got a "stack overflow" (whatever that means ahaha. Sounds bad). I'm going to research what that means, but I imagine the problem could lie there?

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • First Attempt at Arrays. Could use an expert opinion.

      First off, if I create a shared project link to this, and then I delete the project, will the link still work? I don't want future people to lose the benefit of studying it if they need help. (If someone says they get deleted, I'll immediately upload a source code below for future people, because I will probably delete this project eventually). (Project link at the bottom of this post)

      I created a test project just to see if I understand/grasp how to use Arrays correctly. I've never used them before and I don't generally work with code, so if you give advice pertaining to code, treat me like I'm five. Hahaha. Feel free to comment on anything in the project, but I mainly care about the Array stuff specifically. So, send me whatever pointers you wish, but don't feel like you're required to comment on everything if you don't feel up to it. The arrays are really the heart here.

      2c4fbe8b-2615-4d2f-8b5e-7278990590a8-image.png

      While there's a lot of blocks here, what I'm trying to achieve is simple. I will explain the premise as well as a brief description of the block by block in case something confuses you. Again, don't get hung up on stuff. I just care about the Arrays, but for completeness, I want to share the rest.

      All I'm attempting here is to, when above a 500MA, go find the highest and lowest candle in the last 100. And if the highest price is closer than the lowest price (we're likely making a pullback off of the high right now in this case), I want to loop from the highest high back to the lowest low, count how many "down closed candles" there were between the high and the low, take that count and set my array size to it, then I loop back through the candles again, and I attempt to store the opening price and candle ID of all valid candles in the proper index slot for the proper array. At the end, display "done" (I'm aware this doesn't do anything with the values right now. I'm just trying to make sure I'm doing this correctly before I make something absolutely massive with it that no one can hope to understand). I know some of the "useful" logic isn't here, but I would do that kinda stuff on my own. I really wanted to make this simple.

      Block by block, if needed:

      On Init, I try to declare my two arrays. I think I did it right?

      Price above MA, true, we go left, false we go right.

      Store the CandleIDs for the highest and lowest candle in the last 100 candles.

      If the high is closer, then the low is further, and I assume there's a bullish leg. I check this by seeing if the candle ID is lower for the "high" candle.

      So, I want to find "down closed candles" in the assumed leg.

      I set the loop_id equal to that of the High Candle. This is because I will use loop_id for candle ID, and I only want to start at the highest candle. I also set "ValidCandlesFound" to 0. This number will be the ArrayResize value I try to use. Before starting, there is zero valid candles, so my array should ideally be zero at the end of this if no valid candles are found.

      Check if my loop_id value is equal to or less than my "low_candleID" because I want the loop to stop at that candle.

      If the loop_id allows it to pass true, we check if it's a down closed candle. If we get a true output, in the variables tab, I add one to the ValidCandlesFound variable. And whether true or false, I exit to a pass block, just to visually loop the loop up in a friendly way. I also add +1 onto the loop_id at this point, just because I can.

      Once the loop terminates, I attempt to change the size of both of my arrays to the size of "ValidCandlesFound". I've never worked with Arrays before, but I assumed I needed to set the array at a size before I can start cramming values in? If I'm wrong, can I just skip that step and move into the next section? (Which you'll better be able to answer after reading it ahah)

      At this point, I set the loop_id to the ID of the high candle again, and I also set the ArrayIndexID to -1. I heard the first index on an array is "zero," so, setting it to negative one made sense here shortly.

      I again check if the loop_id is within tolerance. If it is:

      I check for down closed candles again. If there is a down closed candle, in the same block, I add one onto the ArrayIndexID.

      In the next block, I store the opening price and the candle ID of the candle in temporary variables, for the next block.

      The next block, I attempt to fill the value of each index with the values stored in the temporary variables.

      If the candle wasn't a down closed candle, I pass the array logic. After exiting the array logic (so either of these), I add one onto my loop_id again and back to the beginning.

      I repeat this until the loop_id exceeds my swing I'm referencing, at which point, it hopefully prints a message on the screen that says "done!" (I've not worked with comments either, so idk if I did that correctly).

      Naturally, the same type of logic is true for the other side, but I want to spare you. Haha. ❤

      So, the biggest things I need to know are:

      Are the On Init declarations correct and necessary?
      Did I need to do the loop to set the array sizes like I did in blocks 25 and 19?
      And, did I fill my arrays correctly in 30/32?

      Furthermore. I didn't know how to attempt it, but say for instance later, one of these points became "invalid" for whatever reason and I wished to remove them from the array? And it was in the "middle" of the array somewhere. Is there a way to remove it and resize the array? Or would it make more sense to pursue an alternative...like repopulating the entire array again from scratch, without that one. Or would it make more sense to store a zero in it or something so that I can ignore it?

      Earlier Link:
      https://fxdreema.com/shared/H017dd00b

      Final Link:
      https://fxdreema.com/shared/kuEfhkS8d

      Thank you so much in advance! ❤

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • RE: First Attempt at Arrays. Could use an expert opinion.

      @roar Thank you for your help and hospitality, Roar!

      I feel I'm still learning and fumbling, but managing with all of the above. I'm sorry for the delay in replying. I just didn't want to rush back in haste. But I still wanted to thank you. So. I appreciate you! I'll keep at it and see if I can keep fairing. Haha.

      Take care until we cross paths again!

      posted in Questions & Answers
      MrDaisyBates
      MrDaisyBates
    • 1
    • 2
    • 2 / 2