Need help with TOP Ultimate Breakout indicator

H

hoojsn

New member
Hi Ben I am new here, Need your help with the following script for TOS. I have found it from some othe place. When it comes to adding it to TOS Script there was an error "Invalid Statement at 134:1."

Code:
#plot Data = close;
input BuyorSell = {default Buy, Sell};
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;
input  ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
#input PriceDigits=NumberFormat.TWO_DECIMAL_PLACES;

input PriceDigit=2;

def H = high;
def L = low;

def h1 = Highest(H, SellExit);
def ih2=if H != h1 then H else 0.0;
#def h2 = Highest(ih2, SellExit);
def h2=fold i =1 to SellExit with ip=0.0 do if GetValue(H,i)==h1 or GetValue(H,i)<ip then ip  else GetValue(H,i);
#def h3 = Highest(if (H == h1 or H == h2) then 0 else H, SellExit);
def h3=fold i1 =1 to SellExit with ip1=0.0 do if GetValue(H,i1)==h1 or GetValue(H,i1)==h2 or GetValue(H,i1)<ip1 then ip1  else GetValue(H,i1);
def HH = (h2 + h3) / 2.0;

#plot pHH=HH;

def l1 = Lowest(L, BuyExit);
#def l2 = Lowest(if L == l1 then 1000000 else L, BuyExit);
def l2=fold i2 =1 to BuyExit with ip2=10000000.0 do if GetValue(L,i2)==l1 or GetValue(L,i2)>ip2 then ip2  else GetValue(L,i2);
def l3 = Lowest(if L == l1 or L == l2 then 1000000 else L, BuyExit);
def LL = (l2 + l2) / 2.0;

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);


def ATRVal = ATR(length = ATRLength,averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

def dl = DisplayLines == yes;
def trade;
plot entry;
switch (BuyorSell){
case Buy:
    trade = 1;
#entry.SetDefaultColor(color.GREEN);
case Sell:
    trade = -1;
}
#AddLabel(1,trade);
#def c1 = (BuyorSell == "Buy") and barnumber() > Max(SellExit, BuyExit);
#def c2 = (BuyorSell == "Sell") and Barnumber() > Max(SellExit, BuyExit);

entry.AssignValueColor(if trade == 1 then Color.GREEN else if trade == -1 then  Color.RED else Color.GREEN);
#entry.setPaintingStrategy(paintingStrategy.LINE);
plot exit;
exit.SetDefaultColor(Color.CYAN);
def EntryPr;
def co = BarNumber() > Max(SellExit, BuyExit);
def pos;
switch (BuyorSell){
case Buy:
    entry = QB[1];
   # entry.SetDefaultColor(Color.GREEN);
#SetPlotWidth(1,1);
    exit = LL[1];
   # exit.SetDefaultColor(Color.BLUE);
#SetPlotWidth(2,1);
    pos = if co and high > QB[1]  then 1 else if low < LL[1] then 0  else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1 then QB[1] else if pos == 0 then Double.NaN else EntryPr[1];
case Sell:

    entry = QS[1];
    #entry.SetDefaultColor(Color.GREEN);
#SetPlotWidth(1,1);
    exit = HH[1];
    #exit.SetPlotColor(Color.BLUE);
#SetPlotWidth(2,1);
    pos = if co and low < QS[1]  then -1 else if  high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1]  and pos == -1  and pos[1] > -1 then QS[1]   else if pos == 0 then Double.NaN  else EntryPr[1];

}

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk ;
switch (BuyorSell){
case Buy:
    BTarget = if pos == 1 and pos[1] < 1 then (EntryPr + (TargetATRMult * 2 * mATR)) else if pos == 1 then BTarget[1] else Double.NaN;

    BTarget2 = if pos == 1 and pos[1] < 1  then (EntryPr + 2 * (TargetATRMult * 2 * mATR)) else if pos == 1 then BTarget2[1]  else Double.NaN;
    EntryLine = if LL < EntryPr then  EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;
case Sell:
    BTarget = if pos == -1 and pos[1] > -1  then (EntryPr - (TargetATRMult * 2 * mATR))  else if pos == -1 then BTarget[1] else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1   then (EntryPr - 2 * (TargetATRMult * 2 * mATR)) else if pos == -1 then BTarget2[1]  else Double.NaN;
    EntryLine = if HH > EntryPr then  EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}
plot  pBTarget = if dl and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot  pBTarget2 = if dl and co  then  BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if dl and co  then  EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

#plot pbt=if dl and co  and (pos == 1 or  pos == -1)  and pos[1] == 0 then BTarget else double.NaN;
#pbt.setPaintingStrategy(paintingStrategy.VALUES_BELOW);
def valco=dl and co  and (pos == 1 or  pos == -1)  and pos[1] == 0;
def rBTarget=round(BTarget,PriceDigit);
def rBTarget2=round(BTarget2,PriceDigit);
def rEntryPr=round(EntryPr,PriceDigit);


AddChartBubble(valco, BTarget,rBTarget, Color.YELLOW);
AddChartBubble(valco, BTarget2, rBTarget2 ,Color.MAGENTA);
AddChartBubble(valco, EntryPr,rEntryPr, Color.WHITE);

def exv=if trade==1 then LL else HH;
def rexv=round(exv,PriceDigit);
def rTradeRisk=round(TradeRisk,PriceDigit);
AddChartBubble(valco,exv,rexv + "(" +rTradeRisk + "ATR)", Color.CYAN);

#AddChartB=ubble(1,H,pos);

#END
 
T

tomsk

Well-known member
VIP
@hoojsn Load the following code, I have cleaned it up for you so that the editor no longer complains of any syntax errors.
Please note that I did not make any changes to the logic

Code:
input BuyorSell = {default Buy, Sell};
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;
input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
#input PriceDigits=NumberFormat.TWO_DECIMAL_PLACES;

input PriceDigit=2;

def H = high;
def L = low;

def h1 = Highest(H, SellExit);
def ih2=if H != h1 then H else 0.0;
#def h2 = Highest(ih2, SellExit);
def h2=fold i =1 to SellExit with ip=0.0 do if GetValue(H,i)==h1 or GetValue(H,i)<ip then ip else GetValue(H,i);
#def h3 = Highest(if (H == h1 or H == h2) then 0 else H, SellExit);
def h3=fold i1 =1 to SellExit with ip1=0.0 do if GetValue(H,i1)==h1 or GetValue(H,i1)==h2 or GetValue(H,i1)<ip1 then ip1 else GetValue(H,i1);
def HH = (h2 + h3) / 2.0;

#plot pHH=HH;

def l1 = Lowest(L, BuyExit);
#def l2 = Lowest(if L == l1 then 1000000 else L, BuyExit);
def l2=fold i2 =1 to BuyExit with ip2=10000000.0 do if GetValue(L,i2)==l1 or GetValue(L,i2)>ip2 then ip2 else GetValue(L,i2);
def l3 = Lowest(if L == l1 or L == l2 then 1000000 else L, BuyExit);
def LL = (l2 + l2) / 2.0;

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

def ATRVal = ATR(length = ATRLength,averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

def dl = DisplayLines == yes;
def trade;
plot entry;

switch (BuyorSell){
case Buy:
    trade = 1;
#entry.SetDefaultColor(color.GREEN);
case Sell:
    trade = -1;
}
#AddLabel(1,trade);
#def c1 = (BuyorSell == "Buy") and barnumber() > Max(SellExit, BuyExit);
#def c2 = (BuyorSell == "Sell") and Barnumber() > Max(SellExit, BuyExit);

entry.AssignValueColor(if trade == 1 then Color.GREEN else if trade == -1 then Color.RED else Color.GREEN);
#entry.setPaintingStrategy(paintingStrategy.LINE);
plot exit;
exit.SetDefaultColor(Color.CYAN);

def EntryPr;
def co = BarNumber() > Max(SellExit, BuyExit);
def pos;

switch (BuyorSell){
case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1 then QB[1] else if pos == 0 then Double.NaN else EntryPr[1];

case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1 then QS[1] else if pos == 0 then Double.NaN else EntryPr[1];
}

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell){
case Buy:
    BTarget = if pos == 1 and pos[1] < 1 then (EntryPr + (TargetATRMult * 2 * mATR)) else if pos == 1 then BTarget[1] else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1 then (EntryPr + 2 * (TargetATRMult * 2 * mATR)) else if pos == 1 then BTarget2[1] else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget = if pos == -1 and pos[1] > -1 then (EntryPr - (TargetATRMult * 2 * mATR)) else if pos == -1 then BTarget[1] else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1 then (EntryPr - 2 * (TargetATRMult * 2 * mATR)) else if pos == -1 then BTarget2[1] else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot pBTarget = if dl and co then BTarget else Double.NaN;
pBTarget.SetDefaultColor(Color.YELLOW);

plot pBTarget2 = if dl and co then BTarget2 else Double.NaN;
pBTarget2.SetDefaultColor(Color.MAGENTA);

plot pEntryLine = if dl and co then EntryLine else Double.NaN;
pEntryLine.SetDefaultColor(Color.WHITE);

#plot pbt=if dl and co and (pos == 1 or pos == -1) and pos[1] == 0 then BTarget else double.NaN;
#pbt.setPaintingStrategy(paintingStrategy.VALUES_BELOW);

def valco=dl and co and (pos == 1 or pos == -1) and pos[1] == 0;
def rBTarget=round(BTarget,PriceDigit);
def rBTarget2=round(BTarget2,PriceDigit);
def rEntryPr=round(EntryPr,PriceDigit);

AddChartBubble(valco, BTarget,rBTarget, Color.YELLOW);
AddChartBubble(valco, BTarget2, rBTarget2 ,Color.MAGENTA);
AddChartBubble(valco, EntryPr,rEntryPr, Color.WHITE);

def exv=if trade == 1 then LL else HH;
def rexv = round(exv,PriceDigit);
def rTradeRisk = round(TradeRisk,PriceDigit);

AddChartBubble(valco,exv,rexv + "(" +rTradeRisk + "ATR)", Color.CYAN);

#AddChartB=ubble(1,H,pos);

#END
 
J

johntermotto

New member
2019 Donor
It looks pretty slick on a 30 minute chart (looking at it on multiple timeframes). White bubble (change mine to grey line) is entry point, yellow bubble & line is estimate target 1, cyan bubble & line is target 2. Blue bubble and line looks like stop placement based on ATR, like a chandelier. On the 30 minute chart, the target 1 is consistent; target 2 fairly consistent. You can confirm because the targets then become consolidation/congestion areas.

I'm looking at /ES, and if you used these inputs, it's showing 10-11 dollar moves as target 1. You take two contracts, that is $1,000. Or sell one and let the 2nd ride to target 2 (that's what I love about /ES; you have more room to wait since it's not decaying like an option). I also have the auto-trendlines up with the 10 daily SMA in TOS, plus lines of former support/resistance and see solid confluence with this script.

Another observation: best to use this when the market is trending up. Look at Monday 12/2. Two trades that would have been stopped out. If you had the daily SMA 10 on your chart, you would have seen the congestion and hopefully taken the $6 profit instead of waiting for target 1.

Nice job @hoojsn and @tomsk. I'm going to track it against my own strategy.
 
T

tomsk

Well-known member
VIP
What does the script do?
It appears to be a breakout strategy with profit targets.
Seems to be part of a commercial trading system, the title of the post suggests the actual name of the indicator being sold
 
H

hoojsn

New member
Wondering anyone can write a script for the scan on the breakout.
 
T

tomsk

Well-known member
VIP
Wondering anyone can write a script for the scan on the breakout.
@hoojsn Here - I have converted the code (based on post #1) so that it is a bullish breakout scan.
Additionally I have also formatted the code so that the logic is easier to follow
Scanning against the S&P 500 I obtained 17 results. Have a look at ticker IBM for example

Code:
# Top Ultimate Breakout Scan
# tomsk
# 12.9.2019

input BuyorSell = {default Buy, Sell};
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;
input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit=2;

def H = high;
def L = low;

def H1  = Highest(H, SellExit);
def ih2 = if H != H1
          then H
          else 0.0;
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(H, i) == H1 or GetValue(H, i) < ip
             then ip
             else GetValue(H, i);

def H3  = fold i1 = 1 to SellExit
          with ip1 = 0.0
          do if GetValue(H, i1) == H1 or GetValue(H, i1) == H2 or GetValue(H, i1) < ip1
             then ip1
             else GetValue(H, i1);
def HH  = (H2 + H3) / 2.0;

def L1  = Lowest(L, BuyExit);
def L2  = fold i2 = 1 to BuyExit
          with ip2 = 10000000.0
          do if GetValue(L, i2) == L1 or GetValue(L, i2) > ip2
             then ip2
             else GetValue(L, i2);
def L3  = Lowest(if L == L1 or L == L2 then 1000000 else L, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

def dl = DisplayLines == yes;
def trade;

switch (BuyorSell) {

case Buy:
    trade = 1;

case Sell:
    trade = -1;
}

def entry;
def exit;
def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1
              then QB[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1
              then QS[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
}

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1
                   then (EntryPr + (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1
                   then (EntryPr - (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot scan = close crosses above entryline;

# End Top Ultimate Breakout Scan
 
Last edited:
H

hoojsn

New member
@tomsk Thanks for your help on the Scan Script.
 
Last edited by a moderator:
J

johntermotto

New member
2019 Donor
Is it possible to reverse the code?l for the scan and indicator? This is great for breakouts; interesting to have one that works on breakdowns.
 
T

tomsk

Well-known member
VIP
@johntermotto Absolutely - The indicator already has both buy/sell signals configured. The default is buy / breakout.
To set this to a sell/breakdown, just load the same indicator and select the input field "buyorsell" to "Sell" in the user interface

Per your request I have COMPLETED the reverse scan - breakdown. I just scanned this against the S&P 500 and obtained 26 results (DAILY)
Have a look at AVGO, NOV, RTN, all showing signs of breakdown.

All the best!

Code:
# Top Ultimate Breakdown Scan
# tomsk
# 12.10.2019

input BuyorSell = {Buy, default Sell};
input BuyEntry = 3;
input SellEntry = 3;
input BuyExit = 20;
input SellExit = 20;
input ATRLength = 50;
input TargetATRMult = 1;
input DisplayLines = yes;
input PriceDigit=2;

def H = high;
def L = low;

def H1  = Highest(H, SellExit);
def ih2 = if H != H1
          then H
          else 0.0;
def H2  = fold i = 1 to SellExit
          with ip = 0.0
          do if GetValue(H, i) == H1 or GetValue(H, i) < ip
             then ip
             else GetValue(H, i);

def H3  = fold i1 = 1 to SellExit
          with ip1 = 0.0
          do if GetValue(H, i1) == H1 or GetValue(H, i1) == H2 or GetValue(H, i1) < ip1
             then ip1
             else GetValue(H, i1);
def HH  = (H2 + H3) / 2.0;

def L1  = Lowest(L, BuyExit);
def L2  = fold i2 = 1 to BuyExit
          with ip2 = 10000000.0
          do if GetValue(L, i2) == L1 or GetValue(L, i2) > ip2
             then ip2
             else GetValue(L, i2);
def L3  = Lowest(if L == L1 or L == L2 then 1000000 else L, BuyExit);
def LL  = (L2 + L2) / 2.0;

def QB = Highest(H, BuyEntry);
def QS = Lowest(L, SellEntry);

def ATRVal = ATR(length = ATRLength, averageType= AverageType.SIMPLE);
def mATR = Highest(ATRVal, ATRLength);

def dl = DisplayLines == yes;
def trade;

switch (BuyorSell) {

case Buy:
    trade = 1;

case Sell:
    trade = -1;
}

def entry;
def exit;
def EntryPr;
def pos;
def co = BarNumber() > Max(SellExit, BuyExit);

switch (BuyorSell) {

case Buy:
    entry = QB[1];
    exit = LL[1];
    pos = if co and high > QB[1] then 1 else if low < LL[1] then 0 else pos[1];
    EntryPr = if high > QB[1] and pos == 1 and pos[1] < 1
              then QB[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
case Sell:
    entry = QS[1];
    exit = HH[1];
    pos = if co and low < QS[1] then -1 else if high[1] > HH[2] then 0 else pos[1];
    EntryPr = if low < QS[1] and pos == -1 and pos[1] > -1
              then QS[1]
              else if pos == 0
                  then Double.NaN
              else EntryPr[1];
}

def BTarget;
def BTarget2;
def EntryLine;
def TradeRisk;

switch (BuyorSell) {

case Buy:
    BTarget  = if pos == 1 and pos[1] < 1
                   then (EntryPr + (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == 1 and pos[1] < 1
                   then (EntryPr + 2 * (TargetATRMult * 2 * mATR))
               else if pos == 1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if LL < EntryPr then EntryPr else Double.NaN;
    TradeRisk = (EntryPr - LL) / mATR;

case Sell:
    BTarget  = if pos == -1 and pos[1] > -1
                   then (EntryPr - (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget[1]
               else Double.NaN;
    BTarget2 = if pos == -1 and pos[1] > -1
                   then (EntryPr - 2 * (TargetATRMult * 2 * mATR))
               else if pos == -1
                   then BTarget2[1]
               else Double.NaN;
    EntryLine = if HH > EntryPr then EntryPr else Double.NaN;
    TradeRisk = (HH - EntryPr ) / mATR;
}

plot scan = close crosses below entryline;

# End Top Ultimate Breakdown Scan
 
Last edited:
J

johntermotto

New member
2019 Donor
Thanks @tomsk, I did not see it had the toggle capability for buy/sell. The breakout/breakdown scans have some promise. You rock!
 
J

john3

Active member
2019 Donor
Warehouse
@tomsk Thank you very much for making it work. My coding skills are very basic, would you please help understand how it works?
I see that it uses 50 ATR of a simple average and it seems to be tracking HH and LL of a 20-period, seems similar to a Donchain channel, but not exactly.

Would you please explain in plain English how the buy signal is triggered? I appreciate your help.
 
J

john3

Active member
2019 Donor
Warehouse
I think I've figured out how it works, the gist of it at least.

It uses a Donchian Channel of 3 and 20. So it is tracking the highest high and the lowest low of 3 and 20 bars.

Long Entry Trigger: the price touches Donchian (3) Upper band and vice-versa for the short entry.
Stoploss: It doesn't seem to be just a simple Donchian (20). Is it ATR(50) subtracted from it? If it's a long entry, the stop-loss has the same slope as the Lower band of Donchain 20, but it doesn't match it exactly. For short entry, it is the Upper band of Donchian (20), but I need help with this one.
Targets: Based on ATR (50)?

Would somebody who knows code please provide a little more clarity? I appreciate it.
 
C

Craighaber71

Member
2019 Donor
Warehouse
Is it possible to have the entry line for buy/sell at the same time
 
J

john3

Active member
2019 Donor
Warehouse
@Craighaber71 You can add the study again and select either Buy or Sell depending on what you've selected the first time.
 
P

Playstation

Active member
VIP
great work as always @tomsk happy new year man, thank you for all the help in 2019!
 
P

Playstation

Active member
VIP


I did a 2 grid comparison on /CL, can even use it on a 5min chart, need not be 30mins. Left grid thick gray line for buy entry, right grid thick gray line for sell entry.
Results are proven to be very good. Do the lines repaint?
Or, if entered buy entry, once right side sell entry gray line appears, it's also a sign to close the buy entry and enter short?
 
Last edited:
J

john3

Active member
2019 Donor
Warehouse
@Playstation The lines don't repaint.

When you enter Long, the blue line below your entry, (gray line) is your stoploss.
When you enter Short, the blue line above your entry (gray line) is your stoploss.

If you use the default settings, the stoploss is very wide. It uses a Donchian channel, so it enters Long/Short on Donchian (3), but the stoploss is Donchian (20). The entry is triggered on the first touch, not on a candle close.
 
C

Craighaber71

Member
2019 Donor
Warehouse
Is there a way to tweek the code to just have the study on one day only....Gets confusing when looking at a five day chart
 

Top