Thread: Ask!
View Single Post
  #1002 (permalink)  
Old 03-06-2008, 02:59 AM
WS168's Avatar
WS168 WS168 is offline
Junior Member
 
Join Date: Jan 2008
Posts: 18
WS168 is on a distinguished road
Thumbs up Anyone can help? Why got false result from backtest ?

Hi CoderGuru,

I have problem from back test at MT4, i want to have reverse signal, while the signal appears,
my code is :
-------------------
Print("Signal Before Check TradeStyle(",TradeStyle,")");
if (Signal == -1) { StrSignal = "ENTRY-SELL"; }
if (Signal == 1) { StrSignal = "ENTRY-BUY"; }
Print("Signal B4 Check TradeStyle : ",StrSignal);

if (TradeStyle == 2) { Signal = -1*Signal; } // THIS IS FOR REVERSE PURPOSE

Print("Signal After Check TradeStyle(",TradeStyle,")");
if (Signal == -1) { StrSignal = "ENTRY-SELL"; }
if (Signal == 1) { StrSignal = "ENTRY-BUY"; }
Print("Signal After Check TradeStyle : ",StrSignal);
--------------------
The TRUE result for TradeStyle = 1 ( value 1 mean Trend Follower ) is :
--------------------
08:08 EURJPY,M1: Signal Before Check TradeStyle(1)
08:08 EURJPY,M1: Signal Before Check TradeStyle : ENTRY-BUY
08:08 EURJPY,M1: Signal After Check TradeStyle(1)
08:08 EURJPY,M1: Signal After Check TradeStyle : ENTRY-BUY

=> THIS RESULT IS RIGHT / TRUE ,
=> TREND RIDER STYLE DIDN'T CHANGE SIGNAL, SO THE RESULT BEFORE AND AFTER CHECK MUST SAME
=> Signal Before Check ENTRY-BUY
=> Signal After check ENTRY-BUY
--------------------
I use same date data and i show the time for let know, that is the same source data, but RESULT IS WRONG !
Below is FALSE result for TradeStyle = 2 ( value 2 mean COUNTER / REVERSE Trend ) is :
--------------------
08:08 EURJPY,M1: Signal Before Check TradeStyle(2)
08:08 EURJPY,M1: Signal Before Check TradeStyle : ENTRY-BUY
08:08 EURJPY,M1: Signal After Check TradeStyle(2)
08:08 EURJPY,M1: Signal After Check TradeStyle : ENTRY-BUY

=> THIS RESULT IS WRONG / FALSE,
=> COUNTER TREND STYLE MUST REVERSE SIGNAL, SIGNAL BEFORE CHECK AND AFTER CHECK MUST REVERSE
=> Signal Before Check ENTRY-BUY
=> Signal After Check ENTRY-BUY => Should ENTRY-SELL

Anyone can help, thanks in advanced
__________________
Win & Success, 168
Reply With Quote