Announcement

Collapse
No announcement yet.

Change to price bar

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

  • Change to price bar

    Hi all,

    Please can anyone tell me whether the code below will turn the price bar yellow on the same bar on which the profit target is breached, or the next one. I am in backtesting mode.

    Thanks

    Deax.


    /*----------------------------------------------------------
    This portion of the code tests for a stop level breach and
    executes trades accordingly.
    ----------------------------------------------------------*/
    if (Strategy.isInTrade() == true && (Strategy.isShort() == true)) {
    // Check if the profit target has been reached/breached
    if (high() >= nStopLevel) {
    // Stop Breached, Execute Cover order.
    Strategy.doCover("Short Stop Exit", Strategy.STOP, Strategy.THISBAR,
    Strategy.getDefaultLotSize(), nStopLevel);
    setPriceBarColor(Color.yellow);
    }
    }

  • #2
    Hello Deax,

    The trade and the coloring of the bar will occur on the same bar where the stop trigger is executed.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X