Capturing a Momentary Value Just Once

VenkateshV
@HowUTrade
I Have a situation where my Buy/sell Level values are populated when certain combination of conditions are met (but very dynamic in nature)....my function output will be the Buy/Sell levels when condition is met else it will return 0...
e.g.......initially it will be 0 --> when Cond met then 385.3 --> and stays at 385.3 as long as the condition is met and if any chances one of the condition go wrong my udf function output value will be 0

Here i want to capture this first value 385.3 and lock it as my fixed trigger levels, with get captured value method, i could capture when my function returns value greater than zero, and it works, however when the dynamic condition goes off and when my function returns 0 again, my get captured value again goes back to zero. due to which my Buy sell trigger not working on my strategy.

Is there a way to capture a non-zero value (i.e. 385.3) once and able to lock the value in a particular cell?
  • HowUTrade
    HowUTrade edited April 2018
    @VenkateshV

    You can use the GetCapturedPrice of Bridge class for the same.
    Once the value is captured, even if the input is zero, it will return the captured price only.
  • nldeshpande
    if you are using it in excel, then you can simply select the cell and

    cells(row,column).formula = cells(row,column).value

    That will freeze the value and you can capture.

    In case you want to revert back to the formula, you can save it in a variable and apply formula to save when you are done.
Sign In or Register to comment.