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

RE: [amibroker] This can't be true, please help !!!



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Graham,
<FONT face=Arial color=#0000ff 
size=2> 
your 
input as always is appreiated.
<FONT face=Arial color=#0000ff 
size=2> 
What I 
am very confused about is why when the program is on the bar which entry is made 
at, why it uses the correct value for PMH to signal teh entry but then is unable 
to use the correct value of PMH to find the entry price. Surely the value of PMH 
should be the smae until the next bar. Thats the issue. How do I know when the 
porgram will change a variable like this mid bar so to speak? Therein lies the 
uncertainty factor.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>Don

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Graham 
  [mailto:gkavanagh@xxxxxxxxxxxxx]Sent: Tuesday, 6 July 2004 12:28 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  How is this possible?
  
  <SPAN 
  >Collectable
  <SPAN 
  > 
  <SPAN 
  >A suggestion is to always have a 
  buy/sell condition as an unique event. This means it happens on a single bar, 
  rather than many bars. This helps by immediately removing many unwanted 
  signals. This will save many headaches later on when you want to condition the 
  sell around the buy bar or price.
  <SPAN 
  > 
  <SPAN 
  >Cond10 = Cross( H, 
  PMH);
  <SPAN 
  >Buy = Cond10;
  <SPAN 
  > 
  <SPAN 
  >The buy price should then be tied 
  to the day of purchase, per buy signal and tradedelays.
  <SPAN 
  > 
  <SPAN 
  >BuyPrice = Valuewhen( Buy, Max(PMH 
  + 0.01, O) ); //if you had trade delays set to 1 then use 
  ref(Buy,-1)
  <SPAN 
  > 
  <SPAN 
  >The finding highest since the 
  lowest of the last 20 bars could be this (just an alternative way of doing 
  it)
  <SPAN 
  > 
  <SPAN 
  >DaysMH = highestsincebars ( L = 
  ref( LLV( L, 20 ), -1 );
  <SPAN 
  > 
  <SPAN 
  >To answer your original problem, 
  you have set the trade delays to 0, so when it looks for PMH this is defined 
  as the high before the buy signal, so on the day of the buy it will see only 
  the value of the day before for PMH. Hope this is not confusing 
  <SPAN 
  >L
  <SPAN 
  >In your PMH and PML you use 
  valuewhen but you need to actually define a unique occurrence for this to be 
  useful, else it just looks at any old possible bar.
  <SPAN 
  > 
  <SPAN 
  >PML = ValueWhen(  
  L== 
  LLV (L, Ref(n, -1)), 
     L, 1); //finds the value of low at lowest low datePMH = 
  ValueWhen( H== 
  HHV (H, Ref(DaysML, 
  -1)), H, 1); //finds the value of high at highest high 
  date
  <SPAN 
  >Hope I have helped a bit, and not 
  confused the issue too much.
  <SPAN 
  > 
  <SPAN 
  > 
  
  <SPAN 
  >Cheers,Graham<A 
  href="">http://e-wire.net.au/~eb_kavan/ 
  
  <SPAN 
  >-----Original 
  Message-----From: 
  Collectable Images [mailto:telecard@xxxxxxxxxxxxxx] <SPAN 
  >Sent: Tuesday, July 06, 2004 9:48 
  AMTo: 
  amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: [amibroker] How is this 
  possible?
  <FONT face="Times New Roman" 
  size=2> 
  <SPAN 
  >Now this will find the LOWEST LOW in the last 20 days 
  and the highest High since that date.All signals are generated on 
  chart correctly to show the buy and sel ldays based on this code. ie when 
  price breaks the highest high (PMH) entry is made so code is referenceing the 
  valuewhen function corectly.Now, when I look at the actual buy and 
  sell prices obtained  it fails to reference the correct values for PMH 
  and looks like it is taking the value of the high from the day before the 
  entry.
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Times New Roman" 
  size=2>I feel I am about to scream with chasing 
  my self round in circles all week!!
  <SPAN 
  ><SPAN 
  >DaysML = Ref(LLVBars(L, 20), -1); //finds the number of 
  days since the lowest low within last 20 daysDaysMH = Ref(HHVBars(H, 
  DaysML), -1); //finds teh highest high since the lowest low 
  datePML = ValueWhen(LLVBars(L, Ref(n, -1)), L, 1); //finds the 
  value of low at lowest low datePMH = ValueWhen(HHVBars(H, Ref(DaysML, 
  -1)), H, 1); //finds the value of high at highest high dateCond10 
  =  H > PMH; //Enter when High of highest day is 
  brokenBuy = Cond10;BuyPrice = Max(PMH + 0.01, O); //Buy 
  Price criteria Buys at 1 cent break of Highest price in last (daysML) number 
  of daysSell = Cross(Ref(LLV(L, 4), -1), L); //sells at break of lowest 
  low in last 4 daysSellPrice = C; //sells at close price of day of 
  breakBuy = ExRem(Buy, Sell);SetTradeDelays(0, 0, 0, 
  0);
  <FONT face="Times New Roman" 
  size=2><FONT 
  face="Courier New">Check AmiBroker web page at:<FONT 
  face="Courier New"><FONT 
  face="Courier New"><A 
  href="">http://www.amibroker.com/<FONT 
  face="Courier New">Check group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Check AmiBroker web page at:<A 
  href="">http://www.amibroker.com/Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.