Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

hrshukla

Members
  • Content Count

    6
  • Joined

  • Last visited

Personal Information

  • First Name
    TradersLaboratory.com
  • Last Name
    User
  • City
    newyork
  • Country
    United States
  • Gender
    Male

Trading Information

  • Vendor
    No
  1. follwing codes ,modified from range expension bars code provided by snowbird. I wanted to plot point when RB close. attached codes does it but not on top of cci. dots as shown in Mock , points plotted are not aligned on top of cci indicator. can some one help tocorrect the codes so that points can be plotted on top of cci //Range Expansion Bars by Uli Schmuli inputs: BarRange(3.75),ccilen(14), PlotRangeBars(true), PlotExpansionBars(true), PlotExpansionPotential(true), BullBarColor(green), BearBarColor(red), RBThickness(3), PlotEMA34(true), PlotLSMA(true); var:RangeHigh(0), RangeLow(0), RangeOpen(open), RangeClose(0), RBcolor(green), LBLow(0), LBHigh(0), LBOpen(0), LBClose(0), offset(0), LBxAvg(0), SmoothingFactor(2/35),mycci(0), LSMAtemp(0); Array: EMA34[100](0), RBHigh[100](close), RBLow[100](close), RBOpen[100](Close), RBClose[100](close), LSMA[100](close), hvalue[100](0); mycci = cci(ccilen); if barnumber = 1 then //1st bar initialization begin if range < BarRange then begin RangeHigh = high; RangeLow = Low; end; if range > BarRange then begin RangeHigh = High; RangeLow = Low; end; hvalue[1] = mycci; LSMA[1] = close; EMA34[1] = close; RBclose[1] = close; LSMA[1] = close; LBopen = open; end else //all other bars Begin if date <> date[1] then //new day, begin new bar & close out prior bar begin LBHigh = RangeHigh; LBlow = RangeLow; LBOpen = RangeOpen; LBclose = iff(close<RBclose[1],RangeLow,RangeHigh); For Value1 = 100 downto 2 begin hvalue[value1] = hvalue[value1-1]; EMA34[value1] = EMA34[value1-1]; RBHigh[value1] = RBHigh[Value1-1]; RBLow[value1] = RBLow[Value1-1]; RBOpen[value1] = RBOpen[Value1-1]; RBClose[value1] = RBClose[value1-1]; LSMA[value1] = LSMA[value1-1]; end; RBHigh[1] = LBHigh; RBLow[1] = LBLow; RBOpen[1] = LBOpen; RBClose[1] = LBClose; hvalue[1] = mycci; EMA34[1] = EMA34[2] + SmoothingFactor * (RBclose[1] - EMA34[2]); value1 = LinRegArray(RBClose,25, 0, value2, value3,value4, LSMAtemp); LSMA[1] = LSMAtemp; RangeOpen = Open; RangeHigh = High; RangeLow = low; RangeClose = close; offset = 1; end; if offset[1] = 1 and date = date[1] then offset = 0; if low >= rangelow and high <= rangehigh then //Bar totally in barrange begin end; if high > Rangehigh and low >= rangelow then //new high value begin rangehigh = high; If high - rangelow > barrange then //New Higher bar detected begin LBlow = RangeLow; LBHigh = RangeLow + BarRange; LBOpen = RangeOpen; LBclose = LBHigh; For Value1 = 100 downto 2 begin hvalue[value1] = hvalue[value1-1]; EMA34[value1] = EMA34[value1-1]; RBHigh[value1] = RBHigh[Value1-1]; RBLow[value1] = RBLow[Value1-1]; RBOpen[value1] = RBOpen[Value1-1]; RBClose[value1] = RBClose[value1-1]; LSMA[value1] = LSMA[value1-1]; end; hvalue[1] = mycci; RBHigh[1] = LBHigh; RBLow[1] = LBLow; RBOpen[1] = LBOpen; RBClose[1] = LBClose; EMA34[1] = EMA34[2] + SmoothingFactor * (RBclose[1] - EMA34[2]); value1 = LinRegArray(RBClose,25, 0, value2, value3,value4, LSMAtemp); LSMA[1] = LSMAtemp; rangeopen = Rangelow + barrange; rangeLow = Rangelow + barrange; RangeClose = rangeopen; offset = 1; end; end; if low < RangeLow and high <= rangehigh then//new low value begin Rangelow = low; if rangehigh - low > barrange then //New lower bar detected begin LBHigh = RangeHigh; LBlow = RangeHigh - barrange; LBOpen = RangeOpen; LBclose = LBlow; For Value1 = 100 downto 2 begin hvalue[value1] = hvalue[value1-1]; EMA34[value1] = EMA34[value1-1]; RBHigh[value1] = RBHigh[Value1-1]; RBLow[value1] = RBLow[Value1-1]; RBOpen[value1] = RBOpen[Value1-1]; RBClose[value1] = RBClose[value1-1]; LSMA[value1] = LSMA[value1-1]; end; RBHigh[1] = LBHigh; RBLow[1] = LBLow; RBOpen[1] = LBOpen; RBClose[1] = LBClose; hvalue[1] = mycci; EMA34[1] = EMA34[2] + SmoothingFactor * (RBclose[1] - EMA34[2]); value1 = LinRegArray(RBClose,25, 0, value2, value3,value4, LSMAtemp); LSMA[1] = LSMAtemp; RangeOpen = LBclose; RangeHigh = LBclose; RangeLow = low; RangeClose = close; offset = 1; end; end; if high > RangeHigh and Low < RangeLow and rangehigh - rangelow > barrange then//engulfing bar begin RangeLow = low; RangeHigh = high; end; end; begin if offset = 1 then //new bar begun begin if RBclose[1] < RBclose[2] then RBcolor = BearBarColor else RBcolor = BullBarColor; plot19[1](hvalue[value1],"ccpoint",RBcolor,default,RBThickness); end; end;
  2. Tams; i have attched Mock . 2nd paragraph , ihave cci indicator valuecci = cci(ccilength) circle shows cci value when LBclose and new bar begins. i wanted to plot those Point on cci when LBclose . !st paragraph has 233 tick chart as data1 and Range Expansion Bar indicator (codes for that are posted in the begining of this topic.
  3. can someone post codes to plot point on an indicator i.e. CCI (2nd paragraph plotted with 133 tick as data1) to show Open of Range Expansion Bar.I am using MC.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.