[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bars plus calculation



PureBytes Links

Trading Reference Links

John,

If I understand you correctly, this following would be the lines to use, so as not to write any text (or do anything) in the 4 bars right after Condition4, or to write text (or do anything) only after the 4 bars. The code is not tested; you will need to check it out. Make sure the bar count is exactly what you want.

-- Harrison

------------------------------

Inputs: BarsPlus(4) ;
Vars: BarsSinceLastText(0) ;

{ Here is your condition }
CONDITION4 = VALUE2{CCI 14} < VALUE2[1] AND VALUE2[1] > 200;{HOOK FROM EXTREME}

{ Reset counter on Condition4 }
IF( CONDITION4 ) then
BarsSinceLastText = 0 ;

{ Write any text only for the 4 bars after Condition4 = True }
IF( BarsSinceLastText > BarsPlus ) THEN
Value1 = TEXT_NEW(DATE,TIME,LOW,"X") ;

BarsSinceLastText = BarsSinceLastText + 1 ;

-------------------

john Davis wrote:

This is a hook from extreme using the cci indicator. I am trying to eliminate any long signals
for about 4 bars after the hook. signals are simply pullbacks against the upward linear regression. if
anyone could show me an example of how to how to extend the barsplus forward I would appreciate it. I have barsplus(4) in my inputs, I have named it as a variable, and I am using values, no plots and I am writing text This seems like a simple line of code.
I hope this is enough info to make sense as to what I want. thanks , John

CONDITION4 = VALUE2{CCI 14} < VALUE2[1] AND VALUE2[1] > 200;{HOOK FROM EXTREME}
IF CONDITION4 THEN BEGIN X = TEXT_NEW(DATE,TIME,LOW,"X");end;


Don't write any text for 4 bars after the hook.