if(BarsInProgress == 1) //DAY BARS
{
pp = Math.Round((Highs[1][0] + Lows[1][0] + Closes[1][0])/3,2);
ppD = Math.Round((Highs[1][0] + Lows[1][0] + Closes[1][0])/3,2);
}
the output window show the result as expected, both pp & ppD are updated at the close of the day bar at 22.00:-
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
11/03/2013 21:55:00
Yesterday Pivot 142.97
Todays Pivot 142.56
Todays Pivot Draw 142.56
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
11/03/2013 22:00:00
Yesterday Pivot 142.56
Todays Pivot 142.7
Todays Pivot Draw 142.7
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
12/03/2013 08:05:00
Yesterday Pivot 142.56
Todays Pivot 142.7
Todays Pivot Draw 142.7
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
How here is what I don't understand. I have one line of code that will enter a position based on pp and one line of code that draws a line based on ppD. Both are calculated on 5 min bars.
if(BarsInProgress == 2)// 5 Min Bars
{
DrawLine("pp" + sessionCount, false, Bars.BarsSinceSession, ppD, 0, ppD ,Color.Black,DashStyle.Dash,2); // DRAWS THE LINE BASED ON VALUE ppD
if(Closes[2][0] > pp && Closes[2][0] < r1) // ENTERS A POSITION BASED ON pp
{
if(longEntryR2 != null) CancelOrder(longEntryR2);
if(longEntryR1 != null) CancelOrder(longEntryR1);
if(longEntryS1 != null) CancelOrder(longEntryS1);
if(longEntryS2 != null) CancelOrder(longEntryS2);
if(longEntryS3 != null) CancelOrder(longEntryS3);
if(shortEntryR3 != null) CancelOrder(shortEntryR3);
if(shortEntryR2 != null) CancelOrder(shortEntryR2);
if(shortEntryR1 != null) CancelOrder(shortEntryR1);
if(shortEntryPP != null) CancelOrder(shortEntryPP);
if(shortEntryS1 != null) CancelOrder(shortEntryS1);
if(shortEntryS2 != null) CancelOrder(shortEntryS2);
for(int i=0;i < strength;i++)
{
if(Lows[2][i] > pp)
{
x++;
}
else
break;
}
if(x == strength && badTradeCountPP <= lossingTradeAllowance && Position.MarketPosition == MarketPosition.Flat && longEntryPP == null)
{
longEntryPP = EnterLongLimit(0,true, 1,pp + entryAllowance * TickSize , "Long Entry PP");
}
x = 0;
}
so if we take the example in the output windows on the 12/03/2013 it should base its entry on pp which is 142.70 and draw a line based on ppD at 142.70.
BUT what is happening is the positions are being placed correctly at 142.70 BUT the line is being drawn at TOMORROWS value of ppD at 142.92?
I bet it has something to do with historical data, but I don't understand why it would show the correct value in the outputwindow and print the line differently.

Comment