Actually would be great to have AB allowing to enter a value (OHLC) for next bar and see how indicators behave. Until we have that, a reverse engineering indicator is useful if, say, you want to know wt what price value of tomorrow the RSI() would be oversold and hence enter a pre-market order to liquidate your long position at x price.
That was a nice feature on a software I use to use in the past (Advanced Get) and again would love to have that into mMibroker. Carl --- In [email protected], Mubashar Virk <mvir...@...> wrote: > > Here is a stupid question. > > What is the utility of a next-bar Indicator? > > On 9/3/2010 6:07 PM, Carl Vanhaesendonck wrote: > > > > Reverse engineer RSI posted earlier: > > > > _SECTION_BEGIN("RSI_Next_Bar"); > > > > //////////////////////////////// > > > > // Reverse Engineer RSI > > > > //////////////////////////////// > > > > Value_Exit_Long = Param("RSI ExitLong", 70, 1, 100, 0.1 ); > > > > Value_Exit_Short = Param("RSI ExitShort", 30, 1, 100, 0.1 ); > > > > WildPer = Param("Time periods", 2, 1, 100 ); > > > > ExpPer = 2 * WildPer - 1; > > > > AUC = EMA( Max( *C* - Ref( *C*, -1 ), 0 ), ExpPer ); > > > > ADC = EMA( Max( Ref( *C*, -1 ) - *C*, 0 ), ExpPer ); > > > > long_x = (WildPer - 1) * ( ADC * Value_Exit_Long / > > (100-Value_Exit_Long) - AUC); > > > > long_RevEngRSI = IIf( long_x >= 0, *C* + long_x, *C* + long_x * > > (100-Value_Exit_Long)/Value_Exit_Long ); > > > > short_x = (WildPer - 1) * ( ADC * Value_Exit_short / > > (100-Value_Exit_short) - AUC); > > > > short_RevEngRSI = IIf( short_x >= 0, *C* + short_x, *C* + short_x * > > (100-Value_Exit_short)/Value_Exit_short ); > > > > Plot( *Close*, Date()+", Close ", *colorBlack*, *styleCandle* ); > > > > Plot( long_RevEngRSI,"LongRevEng. RSI( "+WriteVal(WildPer,1.0)+", > > "+WriteVal(Value_exit_long, 1.2)+" )",*colorGreen* ); > > > > Plot( short_RevEngRSI,"ShortRevEng. RSI( "+WriteVal(WildPer,1.0)+", > > "+WriteVal(Value_exit_short, 1.2)+" )",*colorRed* ); > > > > _SECTION_END(); > > > > >
