Tomasz,
Thank you for your promp answer.
This is the formula for the chart, it is the standard Price formula from the tab "Charts"
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
I have realized that I also have weird events in Volume for the same bars that monthly prices are missing.
Again, I am using the standard Volume formula
_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), ParamColor("Color", colorBlueGrey ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram ) );
_SECTION_END();
I have just updated the database from Norgate pluggin and everything has gone to normal.
Until I run the following code
// Parameters
Positions = Param("Positions", 25, 1, 50, 1);
// --- Backtester settings ---
SetOption("InitialEquity", 10000);
SetOption("MaxOpenshort", 0);
SetOption("MaxOpenLong", Positions);
SetOption("MaxOpenPositions", Positions);
SetOption("AllowPositionShrinking", True);
SetOption("MinShares", 0);
SetOption("HoldMinBars", 1);
SetOption("CommissionMode", 1);
SetOption("CommissionAmount", 0.2);
// --- Constants ---
// --- Variables ---
MktMomPer = 6;
Rank_Limit = Positions;
// --- Formulas ---
// --- Ranking ---
#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"
WlNum = GetOption("FilterIncludeWatchlist");
List = CategoryGetSymbols(categoryWatchlist, WlNum);
if ( Status("stocknum") == 0 )
{
StaticVarRemove("Value*");
for (n = 0; (Symbol = StrExtract(List, n)) != ""; n++)
{
SetForeign (Symbol);
Ticker = WriteIf(StrLen(Name()) < 8, Name(), Strleft(Name(), StrLen(Name()) - 7));
FundValue = Ref(Foreign(Ticker + "_ART_ROE", "V", 2), -1);
FundScore = FundValue + ROC(Close, 1)/1000;
Condition = NorgateIndexConstituentTimeSeries("$SPX") AND FundValue > 0;
Score = IIf(Condition, FundScore, 0);
RestorePriceArrays();
StaticVarSet ("Value" + Symbol, FundValue);
StaticVarSet ("Score" + Symbol, Score);
}
StaticVarGenerateRanks("Rank", "Score", 0, 1224 );
}
Symbol = Name();
Value = StaticVarGet("Value" + Symbol);
Score = StaticVarGet("Score" + Symbol);
Rank = StaticVarGet("RankScore" + Symbol);
// --- Setup ---
Setup = 1; // ROC(Foreign("$SPX", "C"), MktMomPer) > 0;
// --- Conditions ---
BuyCondition1 = Setup AND Rank <= Rank_Limit;
SellCondition1 = Rank > Rank_Limit;
// --- Trading ---
Buy = BuyCondition1;
Sell = SellCondition1;
BuyPrice = Open;
SellPrice = Open;
SetPositionSize(100/Positions, spsPercentOfEquity);
SetTradeDelays(1, 1, 1, 1);
// --- Exploration ---
Filter = 1;
AddColumn(Ref(NorgateIndexConstituentTimeSeries("$SPX"), -1), "Index", 1.0);
AddColumn(Ref(Value, -1), "Value", 1.3);
AddColumn(Ref(Score, -1), "Score", 1.3);
AddColumn(Ref(Rank, -1), "Rank", 1.0);
And everything goes crazy again...
What do you think?