• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Creating a counter with variable input

StockT8er

Member
VIP
Would it be possible to create a counter with a variable input, to use as a delay timer. increasing the number to create a delay.
And if so what would the code be for the counter.
 

rad14733

Well-known member
VIP
Can you give a bit more detail regarding what it is, exactly, you are trying to do...??? What would you use a counter for a variable delay timer for...??? :unsure:
 

StockT8er

Member
VIP
What I thought about while I was out is, using a script, once a signal was trigged it would count the number of marks being that they change many times during a candle and that number count would be a input. you could create a delay to whatever depending on marks counted
Yes trying to create a variable timer. once a buysignal is created to set a delay, and then recheck the the signal to confirm before placing the BuyOrder.
 
Last edited:

rad14733

Well-known member
VIP
Ok... Thanks for the explanation... Unfortunately, my plate is full at the moment but if I get freed up, and nobody steps up, I may be able to take a stab at it...
 

StockT8er

Member
VIP
I just have never used script before and tying to understand the logic. I'm studying the one in the PL_Lables Study and make since of it has this one

Code:
script incrementValue {
    input condition = yes;
    input increment =  1;
    input startingValue = 0;

    def _value = CompoundValue(1,
                 if condition
                 then _value[1] + increment
                 else _value[1], startingValue);

    plot incrementValue = _value;
}
;

just trying to think of how to code the rest, substituting Mark of entryprice etc.
 

FreefallJM03

Member
VIP
What I thought about while I was out is, using a script, once a signal was trigged it would count the number of marks being that they change many times during a candle and that number count would be a input. you could create a delay to whatever depending on marks counted
Yes trying to create a variable timer. once a buysignal is created to set a delay, and then recheck the the signal to confirm before placing the BuyOrder.
Are you trying to do this on a scanner or on a chart itself? I do my buy 1-3 bars after the signal appears on a closed bar basing it off the stocks previous behavior and what difference in price between the past several signals to make an estimate of where my profit target will be on the stock. I only use the signals as a guide to approach a trade.
 

Similar threads

Top