Has anyone ever had an issue when running/backtesting an EFS, where the conditions which need to be triggered for a position to be taken are met, and the Strategy Analyzer takes the trade and it outputs to the Forumla Output window via DebugPrintln, but the draw object never prints to the screen?
Yet on the Formula Output window the debugprintln verifies that it met the conditions and then took the trade?
I have simple Draw Text Relative and DebugPrintln methods for when a LONG/SHORT condition triggers, so when the signal validates to true it should draw the text on the chart and write to the Formula Output window the results.
Except, in my case the EFS failed to draw the text relative on the chart, yet still wrote to the Formula Output window from the DebugPrintLn method that it took the trade. This so far has only happened once, and it is the most recent trade that the EFS took today.
The Condition for entry is just a 2 line MOM indicator that is rising/falling, so nothing complicated in the script.
The following is what I have in postMain() for my LONG entry:
I'm worried I won't be able to trust my EFS if it is giving bad signals or no signals at all. Does anyone have any idea why DrawtextRelative would not print to the chart when the trade signal triggers true, while the Strategy Analyzer and DebugPrintln continue to work fine as before?
Yet on the Formula Output window the debugprintln verifies that it met the conditions and then took the trade?
I have simple Draw Text Relative and DebugPrintln methods for when a LONG/SHORT condition triggers, so when the signal validates to true it should draw the text on the chart and write to the Formula Output window the results.
Except, in my case the EFS failed to draw the text relative on the chart, yet still wrote to the Formula Output window from the DebugPrintLn method that it took the trade. This so far has only happened once, and it is the most recent trade that the EFS took today.
The Condition for entry is just a 2 line MOM indicator that is rising/falling, so nothing complicated in the script.
PHP Code:
( mom(20, hlc3(inv(60)), -1) <= mom(20, hlc3(inv(60)), -2) && mom(20, hlc3(inv(60)), 0) > mom(20, hlc3(inv(60)), -1) )
PHP Code:
if (vLastAlert != 2) Strategy.doLong("Initiate LONG", Strategy.MARKET, Strategy.NEXTBAR, Strategy.DEFAULT, 0);
drawTextRelative(0, BelowBar2, "LONG", Color.RGB(0,0,255), Color.RGB(255,255,0), Text.PRESET | Text.BOLD, "Arial", 13);
setBarBgColor(Color.green); //setBarBgColor(Color.RGB(0,255,0));
debugPrintln("LONG at: " + open(1) + " on " + Today + " " + H + ":" + M + ":" + S + " "); vLastAlert = 2;
I'm worried I won't be able to trust my EFS if it is giving bad signals or no signals at all. Does anyone have any idea why DrawtextRelative would not print to the chart when the trade signal triggers true, while the Strategy Analyzer and DebugPrintln continue to work fine as before?
Comment