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

[amibroker] Re: When last bar is completed?



PureBytes Links

Trading Reference Links

Hi,
I don't understand your last message :-( Could you explain it again ?

I wrote stupid system:

RequestTimedRefresh (3, False);
SetTradeDelays(0,0,0,0);

function GetSecondNum()
{
    // zwraca liczbê sekund z fukcji Now(4)
    Time = Now(4);
    Seconds = int(Time%100);
    Minutes = int(Time/100%100);
    Hours = int(Time/10000%100);
    SecondNum= int(Hours*60*60+Minutes*60+Seconds);
    return SecondNum;
}


Buy = Cross( MACD(), Signal() );
Sell = Cross( Signal(), MACD() );

AASettings = Status("action");
Newperiod = GetSecondNum() % Interval() == 0;

// START - IS IT OK ?????????????????????????????
if (((AASettings == 1) OR (AASettings == 2)) && (NewPeriod)) {
  if (Sell[BarCount-1]) Say( "SELL" );
  if (Buy[BarCount-1])  Say("BUY");
}
// END - IS IT OK ?????????????????????????????

SetChartOptions(0,chartShowArrows|chartShowDates);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
PlotShapes(Buy*shapeUpArrow,colorGreen,0,Low);
PlotShapes(Sell*shapeHollowDownArrow,colorGreen,0,High);


Is this red code OK ? I want to know at the close for last period (last bar) signal for SELL or BUY.



Regards __._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___