Announcement

Collapse
No announcement yet.

trade trigger signal == true, but DrawText relative not Printing to Chart?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • trade trigger signal == true, but DrawText relative not Printing to Chart?

    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.

    PHP Code:
    mom(20hlc3(inv(60)), -1) <= mom(20hlc3(inv(60)), -2) && mom(20hlc3(inv(60)), 0) > mom(20hlc3(inv(60)), -1) ) 
    The following is what I have in postMain() for my LONG entry:

    PHP Code:
    if (vLastAlert != 2Strategy.doLong("Initiate LONG"Strategy.MARKETStrategy.NEXTBARStrategy.DEFAULT, 0); 
    drawTextRelative(0BelowBar2"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 " " ":" ":" " "); 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?
    Last edited by DBBLI; 04-22-2010, 09:47 AM.

  • #2
    update

    Just to add to this....

    Apparently, the DrawTextRelative that was not printed on the chart had only skipped 1 entry signal (even though the Strategy Analyzer picked it up as usual). Now for some reason all drawtextrelative methods are working fine, but still as of now that 1 specific signal that was validated==true, still has not printed to the chart, but all other signals that == true still do.

    This is very weird. I have no idea why it would not print to the chart drawTextRelative for only 1 signal, and then go back to working as normal, just like all the other trade signals when == true work fine as they did before.

    Weird, weird weird.

    Comment

    Working...
    X