Announcement

Collapse
No announcement yet.

Exchange crash EOD!

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

  • Exchange crash EOD!

    On the Aug 25th the CBOT exchange went down. As a result on my back test resulted in an erroneous open trade that doesnt ever get closed out. It resulted in an $2500 gain! Thats nice but, my strategy doesn't hold over night. I want to modify my script somehow to close that trade or anytrade that is open >1600. This is the code im using now. It didn't work because there were no candle prints at that time due to the exchage being down. My time template is 9-1600 and I need to leave it as that. Any ideas? What about using another candle from a different symbol or exchange to grab the time? (cpu intensive?) Thanks..

    PHP Code:
    // EXIT TRADES AT EOD
       
    if(Time == 1559 && Strategy.isInTrade() && Strategy.isShort() ) {
       
    AllowTrading false;
       
    Strategy.doCover"EOD Exit Short"Strategy.CLOSEStrategy.THISBARStrategy.ALL ); }
       else if (
    Time == 1559 && Strategy.isInTrade() && Strategy.isLong() ) {
       
    AllowTrading false;
       
    Strategy.doSell"EOD Exit Long"Strategy.CLOSEStrategy.THISBARStrategy.ALL); }
    // END EOD EXIT CODE 

  • #2
    Hey I got this working with the following code so everyone feel free to not reply. hehe

    PHP Code:
    // EXIT TRADES AT EOD 
       
    if(day(0) != day(1) && Strategy.isInTrade() && Strategy.isShort() ) {
       
    Strategy.doCover"EOD Exit Short"Strategy.CLOSEStrategy.THISBARStrategy.ALL ); 
       
    AllowTrading false;

     }
       else if (
    day(0) != day(1) && Strategy.isInTrade() && Strategy.isLong() ) {
       
    Strategy.doSell"EOD Exit Long"Strategy.CLOSEStrategy.THISBARStrategy.ALL);

       
    AllowTrading false;

    // END EOD EXIT CODE 

    Comment

    Working...
    X