Thanks soni67c, this makes things clearer.
I just noticed that we have hijacked another thread. We are posting inside "IB 
Backfill" thread. Perhaps we should stop or start another one if people want to 
continue discussing performance results of this system.

Regards
Richard

--- In amibroker@yahoogroups.com, "soni67c" <soni...@...> wrote:
>
> 
> 
> Hello Richard ,
> please check this.
> //===========================================================
> //The AB code is defined as: 
> // Vortex Indicator 
> // S&C Traders Tips Jan 2010 
> 
> //The system is defined as:
> //- Go long when the VI (OR Dmi) goes from less than zero to greater //than 
> zero.
> //- Go Short when the VI (OR Dmi) goes from above zero to less than //zero.
> //- All trades are placed "next day market on open."
> //That would translate to:
> period = Param("Period" , 14, 2 ); 
> 
> VMP = Sum( abs( H - Ref( L, -1 ) ), period ); 
> VMM = Sum( abs( L - Ref( H, -1 ) ), period ); 
> STR = Sum( ATR( 1 ), period ); 
> 
> VIP = VMP / STR; 
> VIM = VMM / STR; 
> 
> Oscill = Param("oscil",1,0,1,1); 
> if( Oscill == 0 ) 
> { 
> Plot( VIP , "VIP", IIf(VIP>VIM,colorPaleGreen,colorPaleGreen), 4 ); 
> Plot( VIM , "VIM", IIf(VIP<VIM,colorRed,4), 4 ); 
> Buy=Cross(VIP,VIM ); 
> Sell = Cross(VIM,VIP ); 
> BuyPrice = ValueWhen(Buy,C);//Open;
> SellPrice = ValueWhen(Sell,C);//Open;
> PlotShapes( shapeUpArrow * Buy ,colorBlue);
> PlotShapes( shapeDownArrow * Sell ,colorRed); 
> Plot( Flip( Buy, Sell ), "Trade", colorPaleGreen, styleArea | styleOwnScale, 
> 0, 1 );
> } 
> else 
> if( Oscill == 1 ) 
> { 
> diff=VIP-VIM; 
> vcol= IIf(diff > 0,30,32); 
> Plot( diff , "Diff" ,vcol , 6 );
> Buy = diff > 0 AND Ref(diff,-1) < 0;
> Sell = diff < 0 AND Ref(diff,-1) > 0;
> BuyPrice = ValueWhen(Buy,C);//Open;
> SellPrice = ValueWhen(Sell,C);//Open;
> PlotShapes( shapeUpArrow * Buy ,colorBlue,0,-0.1,0);
> PlotShapes( shapeDownArrow * Sell ,4,0,0.1,0);
> Plot(Flip(Buy, Sell), "Trade", colorPaleGreen,styleArea | styleOwnScale, 0, 
> 1);  
> } 
> Title = EncodeColor(colorWhite)+ "Vortex Indicator-0110" + " - " +  Name() + 
> " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) + 
>  "  - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+"  
> "+"Hi-"+H+"  "+"Lo-"+L+"  "+ 
> "Cl-"+C+"  "+ "Vol= "+ WriteVal(V);
> //====================================================================
> Thank you
> --- In amibroker@yahoogroups.com, "Richard" <richpach2@> wrote:
> >
> > Hi "droskill",
> > 
> > I am a little confused by the rules as well. Sum(abs(....)..) will never go 
> > below 0 and you can see it if you plot VIP or VIM.
> > As the result, he rules do not generate any Buy or Sell signals.
> > Buy=Cross(VIP,1); seems to create some reasonable entries but this is not 
> > what the rules say.
> > 
> > Regards
> > Richard
> > 
> > --- In amibroker@yahoogroups.com, "droskill" <droskill@> wrote:
> > >
> > > The AB code is defined as:
> > > // Vortex Indicator 
> > > // S&C Traders Tips Jan 2010 
> > > period = Param("Period", 14, 2 ); 
> > > 
> > > VMP = Sum( abs( H - Ref( L, -1 ) ), period ); 
> > > VMM = Sum( abs( L - Ref( H, -1 ) ), period ); 
> > > STR = Sum( ATR( 1 ), period ); 
> > > 
> > > VIP = VMP / STR; 
> > > VIM = VMM / STR; 
> > > 
> > > Plot( VIP, "VI"+period+"+", colorBlue); 
> > > Plot( VIM, "VI"+period+"-", colorRed ); 
> > > 
> > > The system is defined as:
> > > 
> > > - Go long when the VI (or Dmi) goes from less than zero to greater than 
> > > zero.
> > > - Go short when the VI (or Dmi) goes from above zero to less than zero.
> > > - All trades are placed "next day market on open."
> > > 
> > > That would translate to:
> > > 
> > > SetTradeDelays(1,1,1,1); // everything delayed 1 day
> > > Buy = VIP > 0 AND Ref(VIP,-1) < 0;
> > > BuyPrice = Open;
> > > Sell = VIP < 0 and Ref(VIP,-1) > 0;
> > > SellPrice = Open;
> > > Short = Sell;
> > > Cover = Buy;
> > > 
> > > That should do it - I've not tested this but it should be close.
> > > 
> > > 
> > > 
> > > --- In amibroker@yahoogroups.com, Bob Waits <bobwaits2@> wrote:
> > > >
> > > > I have the magazine and the formula, but it is only for the oscillator 
> > > > and not for a trading system, which Tradestation and Nuroshell have 
> > > > provided. I was wondering if anybody has used this as a system and 
> > > > tested the validity of this indicator.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ________________________________
> > > > From: droskill <droskill@>
> > > > To: amibroker@yahoogroups.com
> > > > Sent: Wed, December 30, 2009 8:15:57 PM
> > > > Subject: [amibroker] Re: Vortex Indicator
> > > > 
> > > >   
> > > > Here:
> > > > 
> > > > http://www.traders. com/Documentatio n/FEEDbk_ docs/2010/ 
> > > > 01/TradersTips. html#TT4
> > > > 
> > > > --- In amibro...@yahoogrou ps.com, Bob Waits <bobwaits2@ ..> wrote:
> > > > >
> > > > > In the latest S&C magazine, there is a nice article on Vortex 
> > > > > Indicator. While the formula for the indicator is listed in the 
> > > > > magazine, I was wondering if anyone has written a code for turning 
> > > > > this into a system and testing the validity of this indicator. The 
> > > > > Tradestation and Nuroshell has code for an entry, exit and shorting 
> > > > > strategies.
> > > > > 
> > > > > Thanks.
> > > > >
> > > >
> > >
> >
>


Reply via email to