Well just as I thought, I started following the algo right at the peak. This could be a long drawdown or a short one. Considering it's just about 30% dd so far, could be another 20-30% downside. But I'm just going to stick to it and ride the the downfall or ride up. The backtests gotta be worth something Red circle is where I traded the algo live. Just my luck
Still working through the drawdown earlier. Topped off the accoutn to 10k jsut so i can have enough margin to handle the reverses. So I have a b/e sequence function thats programmed into this algo. But one thing I found out about programming a stop and reverse with b/e function into futures is that, you have to deal with partial fills situation that can throw off your b/e target calculation. Breakeven targets need to read the closed losses history and so if you have partial fills, your algo will mistakenly target incorrect b/e level if it sets the target as soon as order is triggered. Example: If each of those fill represent loss, then it's required that the algo waits a few ms to set the target until all reverse lots are accounted for, to make sure the losses history are read correctly, and b/e target is determined accurately. I had close call on 2/2 where my b/e function as it's programmed but did not wait until the complete lots are filled and set the b/e target short. Luckily i was at my desk watching it to manually trade it. Things you learn that you never thought of when running the algo is crazy...
I don't think I can mentally take a DD this big from this strategy. I thought 50% is the worst I could experience, but backtesting it during fall/winter months show bigger dd. I still make more money this method, but It's just way too risky
If I go back to my scalping method, it's an all out approach. Meaning all in for minimal profit or b/e or the day. Just based on backtests, I would have about 97-98% profitable days. Even though I haven't seen catastrophic losses in the backtests (yes zero loss), I used the close calls as the potential loss %. I probably get about 4-5 of those in a given year, which translates to 2% (5/250 days). I know that my loss is 80% of the account (AMP's margin call level). Since any given day, my loss is basically a one hit shot, I can calculate my risk of ruin in a given day: " u" in this case is 1 since it's all out loss for the day if it doesnt' go into profit or b/e ((1-.96)/(1+.96))^1 = about 2-3% risk of ruin to lose 80% of my account
On a 10k account it would retur about 60% based on 1 contract without compounding. Maybe this is the approach I should take. There's no way to eliminate risk of ruin completely. Even with a pre determined stop, you can reach pretty steep drawdown on a string of losing consecutive hits.
Simple fix was adding the sleep function (1 sec) before it calculates and sets the target, so that it waits for all the lots to be executed properly. This worked in backtest, just have to make sure it works in live. Will continue to monitor live and ready to jump in if it doesn't work! Code: if( PP[0]== +1&&TSLM[0]==0) // Target is absent {if(TBLM[0]>=1)REMO(BLM[0][0]); Sleep(1000);SPOS();if(PP[0]== +1) {if(BF==0&&TREN==YES) {TCKV[0]=SymbolInfoDouble(TCKR[0],SYMBOL_TRADE_TICK_VALUE); //TRPP= (CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0]) ; TRPP=MathCeil((CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0])); //TRG=NRDT(OP[0] + TCKS[0]*(TRPP+0.5)+RNG*TRML,DIGT[0]); TRG=NRDT(OP[0] + TCKS[0]* TRPP +RNG*TRML,DIGT[0]); ocom="Trg"+FIN0(PT-1,2)+"_"+DoubleToString(LT[0],2); } //else TRG=NRDT(OP[0]+POIN[0]*(BEPP+0.5),DIGT[0]); else if(BF==1) // !!! obliged {TCKV[0]=SymbolInfoDouble(TCKR[0],SYMBOL_TRADE_TICK_VALUE); //BEPP= (CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0]) ; BEPP=MathCeil((CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0])); //TRG=NRDT(OP[0] + TCKS[0]*(BEPP+0.5) ,DIGT[0]); TRG=NRDT(OP[0] + TCKS[0]* BEPP ,DIGT[0]); ocom="BE_"+FIN0(PT-1,2)+"_"+DoubleToString(LT[0],2); } if(BF==1||TREN==YES) // !!! obliged {s=SSLM(MAGIC,LT[0],TRG,0,0,ocom); } } }else //if( PP[0]== -1&&TBLM[0]==0) // Target is absent //if(TREN==YES&&PP[0]== -1&&TBLM[0]==0) // Target is absent if( PP[0]== -1&&TBLM[0]==0) // Target is absent {if(TSLM[0]>=1)REMO(SLM[0][0]); Sleep(1000);SPOS();if(PP[0]== -1) {if(BF==0&&TREN==YES) {TCKV[0]=SymbolInfoDouble(TCKR[0],SYMBOL_TRADE_TICK_VALUE); //TRPP= (CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0]) ; TRPP=MathCeil((CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0])); //TRG=NRDT(OP[0] - TCKS[0]*(TRPP+0.5)-RNG*TRML,DIGT[0]); TRG=NRDT(OP[0] - TCKS[0]* TRPP -RNG*TRML,DIGT[0]); ocom="Trg"+FIN0(PT-1,2)+"_"+DoubleToString(LT[0],2); } //else TRG=NRDT(OP[0]-POIN[0]*(BEPP+0.5),DIGT[0]); else if(BF==1) // !!! obliged {TCKV[0]=SymbolInfoDouble(TCKR[0],SYMBOL_TRADE_TICK_VALUE); //BEPP= (CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0]) ; BEPP=MathCeil((CMMS-CHPR(ID[0]))/(TCKV[0]*LT[0])); //TRG=NRDT(OP[0] - TCKS[0]*(BEPP+0.5) ,DIGT[0]); TRG=NRDT(OP[0] - TCKS[0]* BEPP ,DIGT[0]); ocom="BE_"+FIN0(PT-1,2)+"_"+DoubleToString(LT[0],2); } if(BF==1||TREN==YES) // !!! obliged {b=SBLM(MAGIC,LT[0],TRG,0,0,ocom); } }
Not sure if you are using Mkt or Lmt orders. In both cases, you cannot be sure that all fills will be received within 1 sec, or within a fix number of second. You need to keep track of the total volume filled until it gets to your total order volume.
Well on the reverse it would be market stop orders. But what you're saying is correct, I can only assume the orders are filled within 1 sec. Which means calculating to make sure the full pre determined lot to fully execute would be better approach.
Created variables reverse lots. Basically algo will now compare net position (after reverse AR) status with calculated reverse lot (CRLT) before setting target. Code: double CMMS,CMMR,TRLT,CRLT,ARLT; void CLRV() // CLEAR FIELDS FOR NEXT PROC { PT =0; GlobalVariableSet(VPROC,PT ); //SINC=0; GlobalVariableSet(VSINC,SINC); BF =0; GlobalVariableSet(VBEFL,BF ); DR =0; GlobalVariableSet(VDRDW,DR ); TRLT=0.0; GlobalVariableSet(VLOTS,TRLT); ARLT=0.0; GlobalVariableSet(VLTAR,ARLT); CMMS=0.0; GlobalVariableSet(VCMMS,CMMS); TIMS+=86400; GlobalVariableSet(VTIMS,TIMS); TIMF+=86400; GlobalVariableSet(VTIMF,TIMF); I think this is it. The final version *fingers crossed! Just need one of those ranging reverse days and partial fills in live to see it work properly.
I want to create a side by side % performance between my algo (gross and net after comm) against the benchmarks SPX/NDX This journal is pretty much done as far as algo development is concerned. Now I'll let run till it dies.. After about 20 or so data points we'll plot the graphs. Let's see if my passive algo can outdo the index in the long run. If it can, I consider this endeavor a success and ready to move the hell on to other things.