Problem in back testing with Message Board

Hello Friends.

  1. I am getting problem in back testing as given below,
    when I check back testing without message board the result shows 5 % & if i add the message board the result drop down by 3 % . Second thing is if i remove the exrem command in formula it is working properly.
  2. I need the message board which will show the entry price of next candle open.

please help me to solve to this problem.

Perhaps u can post your code and explain your issue in more detail?
I personally do not know what you mean by "message board"

Thanks For Your Response Giving the Message Board AFL For Your reference. _SECTION_BEGIN ("massage Board");

no=Param( "Swing", 8, 1, 55 );
tsl_col=ParamColor( "Color", colorLightGrey );
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
dtsl=IIf(avn==1,sup,res);

SellPrice=ValueWhen(Short,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Short,Cover);
Relax = NOT Long AND NOT Buy AND NOT shrt AND NOT Sell AND NOT Sell AND NOT Cover;
SellSL=ValueWhen(Short,DTSL,1);
BuySL=ValueWhen(Buy,DTSL,1);
BuyDifference= BuyPrice - BuySL;
SellDifference = SellSL - SellPrice;

Filter=Buy OR Short;

GraphXSpace = 5;
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 325;

y = pxHeight;
dist = 2ATR(10);
dist1 = 3
ATR(10);
i=BarCount;
bars = i;

messageboard = ParamToggle("Message Board","Show|Hide",1);
if(messageboard)
{
for( i = 0; i < BarCount; i++ )
{
if( Buy[i] )
{

entry = C[i];
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
BuyStop2 = C[i] *.995;
BuyTP1 = C [ i ] * 1.005;
BuyTP2 = C [ i ] * 1.0075;
BuyTP3 = C [ i ] * 1.01;
Buytp4 = C [ i ] * 1.0125;
buyach1 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP1, 0);
buyach2 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP2, 0);
buyach3 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP3, 0);
buyach4 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP4, 0);

GfxSelectFont( "Tahoma", 12, 100 );
GfxSetOverlayMode( mode = 0 );
GfxSelectPen( colorGreen, 3 );
GfxSelectSolidBrush( colorGreen);
GfxRoundRect( x, y - 200, x2, y , 7, 7 ) ;
GfxSetTextColor( colorGold );
GfxTextOut( ( " Signal Panel "),100,y-200);
GfxTextOut( (" "),27,y-160);
GfxSetBkMode(1);
GfxSelectFont( "Arial", 10, 700, False );
GfxSetTextColor( colorWhite );
GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 13, 100 );

GfxTextOut( WriteIf(L[ i ], "Buy @ : "+C[ i ],""), 13, y-180);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(BuyStop2, "Long SL: "+(BuyStop2),""), 13, y-160);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(BuyTP1, "Buy TGT1: "+(BuyTP1),""), 13,y- 140);
GfxTextOut( WriteIf(BuyTP2, "Buy TGT2: "+(BuyTP2),""), 13,y- 120);
GfxTextOut( WriteIf(BuyTP3, "BuyTGT3: "+(BuyTP3),""), 13,y- 100);
GfxTextOut( WriteIf(BuyTP4, "BuyTGT4: "+(BuyTP4),""), 13,y- 80);
GfxSetTextColor( colorWhite );
GfxTextOut( ("Current P/L : " + WriteVal(IIf(Buy ,(C -BuyPrice),(C -BuyPrice)),2.2)), 88, y-22);
GfxTextOut
( ("" + WriteIf (buyach1, " Achieved: "+BuyTP1,"")), 160, y-140);
GfxTextOut
( ("" + WriteIf (buyach2, " Achieved: "+BuyTP2,"")), 160, y-120);
GfxTextOut
( ("" + WriteIf (buyach3, " Achieved: "+BuyTP3,"")), 160, y-100);
GfxTextOut
( ("" + WriteIf (buyach4, " Achieved: "+BuyTP4,"")), 160, y-80);

}
if( Sell[i] )
{

SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,H[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
entry = C[i];
SellStop2 = C[i] * 1.005;
SellTP1 = C [ i ] * .995;
SellTP2 = C [ i ] * .9925 ;
SellTP3 = C [ i ] * .99;
SellTP4 = C [ i ] * .9875;
sellach1 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP1 , 0);
sellach2 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP2, 0);
sellach3 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP3, 0);
sellach4 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP4, 0);

GfxSelectFont( "Tahoma", 13, 100 );
GfxSetOverlayMode( mode = 0 );
GfxSelectPen( colorRed, 3 );
GfxSelectSolidBrush( colorRed );
GfxRoundRect( x, y -200, x2, y , 7, 7 ) ;

GfxTextOut( (" "),27,y-160);
GfxSetBkMode(1);
GfxSelectFont( "Arial", 10, 700, False );
GfxSetTextColor( colorWhite );
GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor( colorGold );
GfxTextOut( ( " Signal Panel "),100,y-200);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(H[ i ], "Sell @ : "+C[ i ],""), 13, y-180);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(SellStop2, "Sell SL: "+(SellStop2),""), 13, y-160);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(SellTP1, "Sell TGT1: "+(SellTP1),""), 13, y-140);
GfxTextOut( WriteIf(SellTP2, "Sell TGT2: "+(SellTP2),""), 13, y-120);
GfxTextOut( WriteIf(SellTP3, "Sell TGT3: "+(SellTP3),""), 13, y-100);
GfxTextOut( WriteIf(SellTP4, "Sell TGT4: "+(SellTP4),""), 13, y-80);
GfxSetTextColor( colorWhite );
GfxTextOut( ("Current P/L : " + WriteVal(IIf(Sell ,(SellPrice-C),(SellPrice-C)),2.2)), 88, y-22);
GfxTextOut
( ("" + WriteIf (sellach1, " Achieved: "+SellTP1,"")), 160, y-140);
GfxTextOut
( ("" + WriteIf (sellach2, " Achieved: "+SellTP2,"")), 160, y-120);
GfxTextOut
( ("" + WriteIf (sellach3, " Achieved: "+SellTP3,"")), 160, y-100);
GfxTextOut
( ("" + WriteIf (sellach4, " Achieved: "+SellTP4,"")), 160, y-80);

}}}
_SECTION_END();

When I use this message board with my afl the result drop down by 3 to 5 % & I need to add the open price of next candle for entry when the signal triggered of buy or sell.

Waiting for your response.

@vijay: A couple of points.

  1. When posting code, please use the CODE BLOCK button (</>). That will help keep the code usable for others attempting to help you out.
  2. It appears that you are trying to solve 2 issues in one thread (My read of your comments).

My suggestions (after only a cursory scan of your posted code, and lots of my own guesses and assumptions):
If you want to reference the Open of Next candle, you might be able to use the "SetTradeDelays" command in your code.

With your statement of "when I use this message board with my afl", I am assuming that you have code that is not included in what you have posted. If that is the case, then you MAY have a variable defined in your code that gets redefined or reassigned in the "message board" code.

You could try posting (using CODE BLOCK) your complete AFL so others can take a look.

Hope this helps.

Thanks, for your response, I will try the same code bu using the set trade delay function.

Code button (use to enter/paste AFL formula)[quote="vijay, post:3, topic:4254"]
Thanks For Your Response Giving the Message Board AFL For Your reference
[/quote]

 _SECTION_BEGIN ("massage Board");

no=Pa`Code button (use to enter/paste AFL formula)`ram( "Swing", 8, 1, 55 );
``tsl`_col=`ParamColor`( "Color", colorLightGrey );`
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
dtsl=IIf(avn==1,sup,res);

SellPrice=ValueWhen(Short,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Short,Cover);
Relax = NOT Long AND NOT Buy AND NOT shrt AND NOT Sell AND NOT Sell AND NOT Cover;
SellSL=ValueWhen(Short,DTSL,1);
BuySL=ValueWhen(Buy,DTSL,1);
BuyDifference= BuyPrice - BuySL;
SellDifference = SellSL - SellPrice;

Filter=Buy OR Short;

GraphXSpace = 5;
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 325;

y = pxHeight;
dist = 2ATR(10);
dist1 = 3ATR(10);
i=BarCount;
bars = i;

messageboard = ParamToggle("Message Board","Show|Hide",1);
if(messageboard)
{
for( i = 0; i < BarCount; i++ )
{
if( Buy[i] )
{

entry = C[i];
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
BuyStop2 = C[i] *.995;
BuyTP1 = C [ i ] * 1.005;
BuyTP2 = C [ i ] * 1.0075;
BuyTP3 = C [ i ] * 1.01;
Buytp4 = C [ i ] * 1.0125;
buyach1 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP1, 0);
buyach2 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP2, 0);
buyach3 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP3, 0);
buyach4 = IIf((Buy OR Long AND NOT Relax AND NOT Cover AND NOT Short AND NOT Shrt), H > BuyTP4, 0);

GfxSelectFont( "Tahoma", 12, 100 );
GfxSetOverlayMode( mode = 0 );
GfxSelectPen( colorGreen, 3 );
GfxSelectSolidBrush( colorGreen);
GfxRoundRect( x, y - 200, x2, y , 7, 7 ) ;
GfxSetTextColor( colorGold );
GfxTextOut( ( " Signal Panel "),100,y-200);
GfxTextOut( (" "),27,y-160);
GfxSetBkMode(1);
GfxSelectFont( "Arial", 10, 700, False );
GfxSetTextColor( colorWhite );
GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 13, 100 );

GfxTextOut( WriteIf(L[ i ], "Buy @ : "+C[ i ],""), 13, y-180);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(BuyStop2, "Long SL: "+(BuyStop2),""), 13, y-160);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(BuyTP1, "Buy TGT1: "+(BuyTP1),""), 13,y- 140);
GfxTextOut( WriteIf(BuyTP2, "Buy TGT2: "+(BuyTP2),""), 13,y- 120);
GfxTextOut( WriteIf(BuyTP3, "BuyTGT3: "+(BuyTP3),""), 13,y- 100);
GfxTextOut( WriteIf(BuyTP4, "BuyTGT4: "+(BuyTP4),""), 13,y- 80);
GfxSetTextColor( colorWhite );
GfxTextOut( ("Current P/L : " + WriteVal(IIf(Buy ,(C -BuyPrice),(C -BuyPrice)),2.2)), 88, y-22);
GfxTextOut
( ("" + WriteIf (buyach1, " Achieved: "+BuyTP1,"")), 160, y-140);
GfxTextOut
( ("" + WriteIf (buyach2, " Achieved: "+BuyTP2,"")), 160, y-120);
GfxTextOut
( ("" + WriteIf (buyach3, " Achieved: "+BuyTP3,"")), 160, y-100);
GfxTextOut
( ("" + WriteIf (buyach4, " Achieved: "+BuyTP4,"")), 160, y-80);

}
if( Sell[i] )
{

SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,H[ i ]);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
entry = C[i];
SellStop2 = C[i] * 1.005;
SellTP1 = C [ i ] * .995;
SellTP2 = C [ i ] * .9925 ;
SellTP3 = C [ i ] * .99;
SellTP4 = C [ i ] * .9875;
sellach1 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP1 , 0);
sellach2 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP2, 0);
sellach3 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP3, 0);
sellach4 = IIf((Short OR Shrt AND NOT Relax AND NOT Sell AND NOT Buy AND NOT Long), L < SellTP4, 0);

GfxSelectFont( "Tahoma", 13, 100 );
GfxSetOverlayMode( mode = 0 );
GfxSelectPen( colorRed, 3 );
GfxSelectSolidBrush( colorRed );
GfxRoundRect( x, y -200, x2, y , 7, 7 ) ;

GfxTextOut( (" "),27,y-160);
GfxSetBkMode(1);
GfxSelectFont( "Arial", 10, 700, False );
GfxSetTextColor( colorWhite );
GfxSetTextAlign(0);
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetTextColor( colorGold );
GfxTextOut( ( " Signal Panel "),100,y-200);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(H[ i ], "Sell @ : "+C[ i ],""), 13, y-180);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(SellStop2, "Sell SL: "+(SellStop2),""), 13, y-160);
GfxSetTextColor( colorWhite );
GfxTextOut( WriteIf(SellTP1, "Sell TGT1: "+(SellTP1),""), 13, y-140);
GfxTextOut( WriteIf(SellTP2, "Sell TGT2: "+(SellTP2),""), 13, y-120);
GfxTextOut( WriteIf(SellTP3, "Sell TGT3: "+(SellTP3),""), 13, y-100);
GfxTextOut( WriteIf(SellTP4, "Sell TGT4: "+(SellTP4),""), 13, y-80);
GfxSetTextColor( colorWhite );
GfxTextOut( ("Current P/L : " + WriteVal(IIf(Sell ,(SellPrice-C),(SellPrice-C)),2.2)), 88, y-22);
GfxTextOut
( ("" + WriteIf (sellach1, " Achieved: "+SellTP1,"")), 160, y-140);
GfxTextOut
( ("" + WriteIf (sellach2, " Achieved: "+SellTP2,"")), 160, y-120);
GfxTextOut
( ("" + WriteIf (sellach3, " Achieved: "+SellTP3,"")), 160, y-100);
GfxTextOut
( ("" + WriteIf (sellach4, " Achieved: "+SellTP4,"")), 160, y-80);

}}}`Code button (use to enter/paste AFL formula)`
_SECTION_END();

When I use this message board with my afl the result drop down by 3 to 5 % & I need to add the open price of next candle for entry when the signal triggered of buy or sell.

Waiting for your response.