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

Re: [amibroker] Re: Optimizer results "0.00" and "N/A"



PureBytes Links

Trading Reference Links




well actually to catch the last bar you need to 
use:

<FONT 
face="Courier New"> 
timebar = 
Cross(<FONT 
color=#0000ff>TimeNum(),<FONT 
color=#ff00ff>155900<FONT 
face="Courier New" size=3>); <FONT face=Arial 
size=2><FONT face="Courier New" 
size=3>
<FONT 
face="Courier New" size=3>and then you have to use a densely traded stock 
because for ENZN for instance it does not see the last bar this way. .... you 
need to use more like 155000
<FONT 
face="Courier New" size=3> 
so if there are other ways to get this last bar I 
am still interested,
 
rgds, Ed
<FONT 
face="Courier New" size=3> 

<BLOCKQUOTE dir=ltr 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  ed 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Thursday, May 20, 2004 3:11 
PM
  Subject: Re: [amibroker] last bar in day, 
  close price
  
  it seems to work.
   
  I defined: 
  timebar = 
  Cross(<FONT 
  color=#0000ff>TimeNum(),<FONT 
  color=#ff00ff>160000<FONT 
  face="Courier New" size=3>); 
  and then in the loop I 
  use:
  <FONT 
  face="Courier New">if 
  (L[ i ] > B1[ 
  i ] AND 
  H[ i ] < HBOP[ 
  i ] AND timebar[ 
  i ] == 1<FONT 
  color=#000000>) { 
  
  <FONT 
  face="Courier New" size=3> 
  <FONT face=Arial 
  size=2>thanks for your help
   
  rgds, Ed<FONT 
  color=#000000>
  <FONT 
  size=2>
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    Herman van den 
    Bergen 
    To: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Sent: Thursday, May 20, 2004 2:18 
    PM
    Subject: RE: [amibroker] last bar in 
    day, close price
    Perhaps there is something in this toolbox-snippet that 
    you can use:// RT Time referencesStartOfDay = DateNum() != 
    Ref(DateNum(),-1);EndOfDay = (DateNum() != Ref(DateNum(),1)) OR 
    (BarIndex() == 
    (BarCount-1));DaysOpenBar=Cross(TimeNum(),093000);DaysCloseBar=Cross(TimeNum(),160000);PreHours 
    = TimeNum() < 093000;AfterHours = TimeNum() > 
    160000;NormalHours = NOT (PreHours OR AfterHours);// Significant 
    PricesDaysFirstPrice = ValueWhen(StartOfDay, Open);DaysOpenPrice = 
    TimeFrameGetPrice("O",inDaily);DaysLastPrice = ValueWhen(EndOfDay, 
    Close);DaysClosePrice = TimeFrameGetPrice("C",inDaily);PreHourChange 
    = DaysOpenPrice - DaysFirstPrice;AfterHoursChange = DaysLastPrice - 
    DaysClosePrice;DayChange = DaysClosePrice - 
    DaysOpenPrice;/*Plot(C,"C",1,128);Plot(DaysFirstPrice,"DaysFirstPrice",5,1);Plot(DaysLastPrice 
    ,"DaysLastPrice ",4,1);Plot(DaysOpenPrice ,"DaysOpenPrice 
    ",6,1);Plot(DaysClosePrice ,"DaysClosePrice 
    ",7,1);Plot(EndOfDay,"",4,2|styleOwnScale,0,1);Plot(StartOfDay,"",5,2|styleOwnScale,0,1);Plot(DaysOpenBar,"",6,2|styleOwnScale,0,1);Plot(DaysCloseBar,"",7,2|styleOwnScale,0,1);Plot(PreHours 
    ,"",6,2|styleOwnScale|styleArea,0,1);Plot(NormalHours 
    ,"",7,2|styleOwnScale|styleArea,0,1);Plot(AfterHours 
    ,"",9,2|styleOwnScale|styleArea,0,1);-----Original 
    Message-----From: ed [mailto:ed2000nl@xxxxxxx]Sent: Thursday, May 
    20, 2004 7:42 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: 
    [amibroker] last bar in day, close priceImportance: 
    HighHerman,I don't think so. I want to know that I am 
    seeing the last bar of the day tobe able to enter the "if statement". 
    Only if the price stays within certainlimits the entire day then I want 
    to enter the "if statement". Now I lookone day ahead to find this 
    bar:AND phase_arr[ i ] == 1 AND phase_arr[ i + 1] != 1So I need 
    to know that I see the last "hour" or "minute" bar of that daybefore I 
    want to enter the "if statement". Here the "if statement" I usecurrently 
    that uses a future 
    bar:         // stay in area 
    1 and cover position at the 
    close         if (L[ i ] > 
    B1[ i ] AND H[ i ] < HBOP[ i ] AND phase_arr[ i ] == 1AND phase_arr[ 
    i + 1] != 1) 
    {            
    // cover at 
    close            
    Cover[ i ] = 
    1;            
    CoverPrice[ i ] = C[ i 
    ];            
    reaction_position_short = 
    0;         } elseSo 
    I like the code to look like without using a future 
    bar:         // stay in area 
    1 and cover position at the 
    close         if (L[ i ] > 
    B1[ i ] AND H[ i ] < HBOP[ i ] ANDThisIsTheLastBarOfThisDay) 
    {            
    // cover at 
    close            
    Cover[ i ] = 
    1;            
    CoverPrice[ i ] = C[ i 
    ];            
    reaction_position_short = 
    0;         } 
    elseregards,Ed----- Original Message 
    -----From: Herman van den BergenTo: 
    amibroker@xxxxxxxxxxxxxxxSent: Thursday, May 20, 2004 1:23 
    PMSubject: RE: [amibroker] last bar in day, close pricecan't 
    you useDaysClosePrice = 
    TimeFrameGetPrice("C",inDaily);herman-----Original 
    Message-----From: ed [mailto:ed2000nl@xxxxxxx]Sent: Thursday, May 
    20, 2004 6:58 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
    last bar in day, close pricehello,I want to be able find 
    the close price of the last bar inside a day usingintraday 
    data.The problem is that if the price stays within a certain range 
    during the daythe position is closed at the close price. However I need 
    to know what thelast bar is of that day otherwise it would close out the 
    position at thefirst intraday bar.The condition therefor 
    becomes:1) Price is within the range.2) AND this is the last 
    intraday bar of this day.Currently I look one bar ahead to find that 
    it is the last bar of this daybut this is not what I want,thanks 
    for help,rgds, EdSend BUG REPORTS to 
    bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at:<A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlSend 
    BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at:<A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlSend 
    BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at:<A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlYahoo! 
    Groups SponsorADVERTISEMENTYahoo! Groups 
    LinksTo visit your group on the web, go to:<A 
    href="">http://groups.yahoo.com/group/amibroker/To 
    unsubscribe from this group, send an email 
    to:amibroker-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! 
    Groups is subject to the Yahoo! Terms of 
    Service.Send BUG REPORTS to 
    bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
    SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx-----------------------------------------Post 
    AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: 
    <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
    group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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.