Question for experienced Excel users...

Discussion in 'Automated Trading' started by CowboyBlue, Aug 13, 2009.

  1. As mentioned above, small variation:
    =If(k12=-420,-420,if(j13<=400,-420,j13))
    This locks in -420 once it has been triggered, no matter what happens to the J column (going up whatever) after.
    Just drag that down to as many k cells
    as you want.

    Cheers.
     
    #11     Aug 13, 2009
  2. by J13 do you mean J12??? if so and thats the equation thank you so much i really appreciate it! thx alot for your time!

    -Dan

    Doesnt seem to work now everything equals -420

    ok now sems to work will check tomorrow thx alot for your time!!!!
     
    #12     Aug 13, 2009
  3. This is about as clear as I can make it, without you attaching the actual excel file, and having me modify it.

    [​IMG]

    GL.:)
     
    #13     Aug 13, 2009
  4. It appears to work thx alot! if not i will send you the sheet tomorrow....
     
    #14     Aug 13, 2009
  5. P.S. earlier posts had small typo,
    =If(k12=-420,-420,if(j13<=400,-420,j13))
    should have been j13<= -400 not +400
    that is likely why all the cells were -420.
    Current jpg I posted has correct formula.

    Glad to see it works for you.
     
    #15     Aug 13, 2009
  6. yeah it seems to work great.... the other problem was that it should be j12 instead of j13, i am doing it sideways not on a cell below....

    i will need a couple days to figure out wether or not it actually locks but im not gonna lie im doing hail mary's and wearing my lucky boxers so that i just dont get stopped out on any position :)

    anyways thx asgain!!!

    -Dan
     
    #16     Aug 13, 2009
  7. LOL, that's a cool formula.

    *you learn something new every day* :)
     
    #17     Aug 13, 2009
  8. aah.. looking over the posts again, I think I may have misinterpreted your description. I think (correct me if I"m wrong) that you are updating the variable cell "I", dynamically in real-time, and want the j value threshold functions to track, then lock on that dynamically changing cell, once the threshold is triggered? That is why I think you kept referring to the adjacent J cell, and not the prior J cell, no? In which case, the earlier posters understood your request better.

    Two ways to solve:
    1) I assume you must be using vba to dynamically update the cell "I", in which case you can create a latch function in vba to do what you want. This is the better approach and does not require extra columns/cells.
    2) If you want to keep it in excel, you must create an additional adjacent cell, "K", to serve as a counter/register that will hold your latch value. One other cell, (K1) will be used to reset it Follow the instructions on the image i attached. If you want to update multiple cells, just copy the formulas down.

    dt98
    [​IMG]

    P.S. I used cells "I/J/K" in this example, instead of "J/K", but I think you can follow.
     
    #18     Aug 14, 2009