We have tried, close, but not perfect

Optuma Forums Optuma Scripting Tom Demark Indicators We have tried, close, but not perfect

#53355
Chad
  • Topics: 4
  • Replies: 13
  • Posts: 17

Hey Mandeep, maybe we can work  together to fine tune the code we are using as it’s close but not perfect.  Are you familar with the rule’s for the Sequential/others?  Im not as versed at the detailed rules so I’d be really happy if you can pick some holes in the codes below.

//Buy Countdown // Note the direction of the trend bTrendDn = C < C[4]; bTrendUp = C > C[4]; // we need a signal when the trend changes bTrendChangeDn = bTrendDn ChangeTo 1; bTrendChangeUp = bTrendUp ChangeTo 1; // if the trend is persistent, how many bars has it been iBuySetupCnt = If(bTrendDn, TIMESINCESIGNAL(bTrendChangeDn) + 1, 0); iSellSetupCnt = If(bTrendUp, TimeSinceSignal(bTrendChangeUp) + 1, 0); // if we hit 9 then the setup is complete bBuyComplete = IF(iBuySetupCnt == 9, 1, 0); bSellComplete = if(iSellSetupCnt == 9, 1, 0); // which mode are we in bBuyMode = switch(bBuyComplete, bSellComplete); // do we satisfy the countdown criteria bLow2 = C < L[2]; // how many valid countdown bars since the setup was complete iBuyCountDown = if(bBuyMode, ACCSINCESIGNAL(bLow2, bBuyComplete), 0); // if we hit 13 then the setup is complete IF(iBuyCountDown < 14, iBuyCountDown, 0);

//Buy Setup bTrendDn = C < C[4]; bTrendChange = bTrendDn ChangeTo 1; iBuySetupCnt = If(bTrendDn, TIMESINCESIGNAL(bTrendChange) + 1, 0); IF(iBuySetupCnt < 10, iBuySetupCnt, 9) > 6 and IF(iBuySetupCnt < 10, iBuySetupCnt, 9) < 10

//Sell Countdown // Note the direction of the trend bTrendDn = C < C[4]; bTrendUp = C > C[4]; // we need a signal when the trend changes bTrendChangeDn = bTrendDn ChangeTo 1; bTrendChangeUp = bTrendUp ChangeTo 1; // if the trend is persistent, how many bars has it been iBuySetupCnt = If(bTrendDn, TIMESINCESIGNAL(bTrendChangeDn) + 1, 0); iSellSetupCnt = If(bTrendUp, TimeSinceSignal(bTrendChangeUp) + 1, 0); // if we hit 9 then the setup is complete bBuyComplete = IF(iBuySetupCnt == 9, 1, 0); bSellComplete = if(iSellSetupCnt == 9, 1, 0); // which mode are we in bSellMode = switch(bSellComplete, bBuyComplete); // do we satisfy the countdown criteria bHigh2 = C > H[2]; // how many valid countdown bars since the setup was complete iSellCountDown = if(bSellMode, ACCSINCESIGNAL(bHigh2, bSellComplete), 0); // if we hit 13 then the setup is complete IF(iSellCountDown < 14, iSellCountDown, 0);

 

//Sell Setup bTrendUp = C > C[4]; bTrendChange = bTrendUp ChangeTo 1; iSellSetupCnt = If(bTrendUp, TIMESINCESIGNAL(bTrendChange) + 1, 0); IF(iSellSetupCnt < 10, iSellSetupCnt, 9) > 6 and IF(iSellSetupCnt < 10, iSellSetupCnt, 9) < 10

 

 

Pin It on Pinterest