Jump to content

VON KRIEGER

⭐ V.I.P.
  • Posts

    534
  • Joined

  • Last visited

  • Days Won

    28

Reputation Activity

  1. Like
    ⭐ VON KRIEGER got a reaction from ⭐ epictetus in BTC Aggregated Volume   
    10 exchanges aggregated spot volume of Bitcoin .
     
    Here are the listed exchanges :
    - Okex
    - Huobi
    - Binance
    - Bitfinex
    - Bitstamp
    - Coinbase
    - FTX
    - Kraken
    - Gemini
    - Phemex
     
    https://pastebin.com/aF2NwJWi
     
     
     
     
     
     
    Unlike my previous post consider liking this one :P
  2. Like
    ⭐ VON KRIEGER got a reaction from ⭐ laser1000it in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  3. Like
    ⭐ VON KRIEGER got a reaction from groman in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  4. Like
    ⭐ VON KRIEGER got a reaction from ⭐ laser1000it in Turtle Trading System (Strategy & Indicator)   
    okay got the issue..
     
    aliment got wrong when you copy and paste the code
    https://ibb.co/6DLXxgt
  5. Like
    ⭐ VON KRIEGER got a reaction from ⭐ laser1000it in Turtle Trading System (Strategy & Indicator)   
    https://ibb.co/x1ZMzQ5
     
    https://ibb.co/sjSP637
  6. Like
    ⭐ VON KRIEGER got a reaction from ⭐ laser1000it in Turtle Trading System (Strategy & Indicator)   
    PineScript :-
     
    //@version=4
    // To change this from a Strategy to a Indicator:-
    // 1) uncomment the next line and comment out the strategy line.
    // 2) at the end of the file comment out the last 2 lines
     
    // study(title="VonKrieger_Turtle_Indicator", overlay=true)
    strategy(title="VonKrieger_Turtle_Strategy", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1, pyramiding=5)
     
    stopInput = input(2.0, "Stop N", step=.5)
    pyramidInput = input(1, "Pyramid N", step=.5)
    l1LongInput = input(20, "L1 Long", minval=5)
    l2LongInput = input(55, "L2 Long", minval=5)
    l1LongExitInput = input (10, "L1 Long Exit", minval=5)
    l2LongExitInput = input (20, "L2 Long Exit", minval=5)
     
    FromYear = input(2000, "From Year", minval=1900), FromMonth = input(1, "From Month", minval=1, maxval=12), FromDay = input(1, "From Day", minval=1, maxval=31)
    ToYear = input(9999, "To Year", minval=1900), ToMonth = input(1, "To Month", minval=1, maxval=12), ToDay = input(1, "To Day", minval=1, maxval=31)
    FromDate = timestamp(FromYear, FromMonth, FromDay, 00, 00), ToDate = timestamp(ToYear, ToMonth, ToDay, 23, 59)
    TradeDateIsAllowed() => time >= FromDate and time <= ToDate
    l1Long = highest(l1LongInput)
    l1LongExit = lowest(l1LongExitInput)
    l2Long = highest(l2LongInput)
    l2LongExit = lowest(l2LongExitInput)
     
    bool win = false // tracks if last trade was winning trade of losing trade.
    float totalPrice = 0.0 // tracks total price, used for calculating avgPrice
    float buyPrice = 0.0 // tracks the buy price of the last long position.
    float avgPrice = 0.0 // tracks the avg price of all currently held long positions.
    float nextBuyPrice = 0.0 // tracks the next buy price
    float stopPrice = na // tracks the stop price
    int totalBuys = 0 // tracks the total # of pyramid buys
    bool inBuy = false // tracks if we are in a long position or not.
    float l1LongPlot = highest(l1LongInput) // tracks the L1 price to display
    float l2LongPlot = highest(l2LongInput) // tracks the L2 price to display
    float n = atr(14) // tracks the n used to calculate stops and pyramid buys
    string mode = 'L1' // tracks whether we are in a L1 position or L2 position.
    bool fake = na // tracks if this is a fake trade, see comments below.
    string longLevel = na // tracks where long positions, stops, pyramid buys occur.
     
    // by default use the last value from the previous bar.
    buyPrice := buyPrice[1]
    totalBuys := totalBuys[1]
    nextBuyPrice := nextBuyPrice[1]
    stopPrice := stopPrice[1]
    avgPrice := avgPrice[1]
    totalPrice := totalPrice[1]
    win := win[1]
     
    // State to track if we are in a long positon or not.
    inBuy := not inBuy[1] and (close > l1Long[1] or close > l2Long[1]) ? true : inBuy[1]
    inBuy := inBuy[1] and close < stopPrice ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L1' and close < l1LongExit[1] ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L2' and close < l2LongExit[1] ? false : inBuy
     
     
    // State to track if we are ia a fake trade. If the last trade was a winning, we need to skip the next trade.
    // We still track it though as a fake trade (not counted against us). as the outcome determines if we can
    // can take the next trade.
    fake := not inBuy[1] and close > l1Long[1] and win[1] ? true : fake[1]
    fake := not inBuy[1] and close > l1Long[1] and not win[1] ? false : fake
    fake := close > l2Long[1] ? false : fake
     
    // Series representing the l1 and l2 levels. If we break out above the l1 or l2 level, we want the
    // line to stay at the breakout level, not follow it up.
    l1LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l1Long[1],l1LongPlot[1])
    l2LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l2Long[1],l2LongPlot[1])
     
    // Variable in the series is only set when it happens. Possible values is L1, L2, SR
    // (stopped out with a loss), SG (exited with a gain), and 'P' for pyramid buy.
    longLevel := not inBuy[1] and close > l1Long[1] ? 'L1' : na
    longLevel := not inBuy[1] and close > l2Long[1] ? 'L2' : longLevel
    longLevel := not inBuy[1] and close > l1Long[1] and close > l2Long[1] and fake ? 'L2' : longLevel
    // longLevel := longLevel == na and close > l2Long[1] and mode[1] != 'L2' ? 'L2' : longLevel
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' ? na : longLevel // don't switch to L2 if we are already in a L1
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' and fake[1] ? 'L2' : longLevel
     
    // Either 'L1' or 'L2' depending on what breakout level we are in.
    mode := longLevel == na ? mode[1] : longLevel
     
    // Variables to track calculating avgPrice and nextBuyPrice for pyramiding.
    if longLevel == 'L1' or longLevel == 'L2'
    buyPrice = close
    totalBuys := 1
    totalPrice := close
    avgPrice := buyPrice
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Marks if we hit our next buy price, if so mark it with a 'P'
    longLevel := inBuy[1] and close > nextBuyPrice and TradeDateIsAllowed() and totalBuys < 5 ? 'P' : longLevel
     
    if longLevel == 'P'
    buyPrice = close
    totalBuys := totalBuys[1] + 1
    totalPrice := totalPrice[1] + buyPrice
    avgPrice := totalPrice / totalBuys
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Tracks stops and exits, marking them with SG or SR
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close < avgPrice ? 'SR' : longLevel
     
    // Tracks if the trade was a win or loss.
    win := longLevel == 'SG' ? true : win
    win := longLevel == 'SR' ? false : win
     
    // Variables used to tell strategy when to enter/exit trade.
    enterLong = (longLevel == 'L1' or longLevel == 'L2' or longLevel == 'P') and not fake and TradeDateIsAllowed()
    exitLong = (longLevel == 'SG' or longLevel == 'SR') and not fake and TradeDateIsAllowed()
     
    p1 = plot(l1LongPlot, title="l1 long", linewidth=3, style=plot.style_stepline, color=color.green)
    p2 = plot(l1LongExit[1], title="l1 exit", linewidth=3, style=plot.style_stepline, color=color.red)
    p3 = plot(l2LongPlot, title="l2 long", linewidth=2, style=plot.style_stepline, color=color.green)
    p4 = plot(l2LongExit[1], title="l2 exit", linewidth=2, style=plot.style_stepline, color=color.red)
    color1 = color.new(color.black, 0)
    color2 = color.new(color.black, 100)
    col= (inBuy) ? color1 : color2
    p5 = plot(stopPrice, title="stop", linewidth=2, style=plot.style_circles, join=true, color=col)
    p6 = plot(nextBuyPrice, title="next buy", linewidth=2, style=plot.style_circles, join=true, color=col)
     
    fill(p1, p3, color=color.green)
    fill(p2, p4, color=color.red)
     
    plotshape(longLevel == 'L1' and not fake ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape(fake and longLevel == 'L1' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape((mode == 'L2' or (mode == 'L1' and not fake)) and longLevel == 'P' ? true : false, color=color.green, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(mode == 'L1' and fake and longLevel == 'P' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(longLevel == 'L2' ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L2") // up arrow for entering L2 trade
     
    plotarrow(longLevel == 'L1' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L1 trade
    plotarrow(longLevel == 'L2' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L2 trade
    plotarrow(longLevel == 'SR' ? -1 : 0, colordown=color.red, colorup=color.purple, transp=40) // down arrow for losing trade
    plotarrow(longLevel == 'SG' ? -1 : 0, colordown=color.green, colorup=color.purple, transp=40) // down arrow for winning trade
     
    // plotarrow(win ? -1 : 0, colordown=color.yellow, colorup=color.purple, transp=40) // down arrow for winning trade
    // plotshape(inBuy[1], color=color.blue, transp=40, text='X') // down arrow for winning trade
    // label.new(bar_index, high, style=label.style_none, text=longLevel)
     
    alertcondition(low < stopPrice, title="crosses under stop price", message="price crossed under stop price")
    alertcondition(high > l1Long, title="crosses over L1 price", message="price crossed over L1 price")
    alertcondition(high > l2Long, title="crosses over L2 price", message="price crossed over L2 price")
    alertcondition(low < l1LongExit, title="crosses under L1 exit price", message="price crossed under L1 exit price")
    alertcondition(low < l2LongExit, title="crosses under L2 exit price", message="price crossed under L2 exit price")
     
    strategy.entry("long", strategy.long, comment='long', when=enterLong)
    strategy.close("long", when=exitLong)
     
    [/color][/i][/i][/b][/color][/color][/font][/font][/size]
  7. Like
    ⭐ VON KRIEGER got a reaction from highappmatrix in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  8. Like
    ⭐ VON KRIEGER got a reaction from melauf in Turtle Trading System (Strategy & Indicator)   
    okay got the issue..
     
    aliment got wrong when you copy and paste the code
    https://ibb.co/6DLXxgt
  9. Like
    ⭐ VON KRIEGER got a reaction from ⭐ laser1000it in Turtle Trading System (Strategy & Indicator)   
    yes kinda... not exactly close..
  10. Like
    ⭐ VON KRIEGER got a reaction from melauf in Turtle Trading System (Strategy & Indicator)   
    https://ibb.co/x1ZMzQ5
     
    https://ibb.co/sjSP637
  11. Like
    ⭐ VON KRIEGER got a reaction from melauf in Turtle Trading System (Strategy & Indicator)   
    PineScript :-
     
    //@version=4
    // To change this from a Strategy to a Indicator:-
    // 1) uncomment the next line and comment out the strategy line.
    // 2) at the end of the file comment out the last 2 lines
     
    // study(title="VonKrieger_Turtle_Indicator", overlay=true)
    strategy(title="VonKrieger_Turtle_Strategy", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1, pyramiding=5)
     
    stopInput = input(2.0, "Stop N", step=.5)
    pyramidInput = input(1, "Pyramid N", step=.5)
    l1LongInput = input(20, "L1 Long", minval=5)
    l2LongInput = input(55, "L2 Long", minval=5)
    l1LongExitInput = input (10, "L1 Long Exit", minval=5)
    l2LongExitInput = input (20, "L2 Long Exit", minval=5)
     
    FromYear = input(2000, "From Year", minval=1900), FromMonth = input(1, "From Month", minval=1, maxval=12), FromDay = input(1, "From Day", minval=1, maxval=31)
    ToYear = input(9999, "To Year", minval=1900), ToMonth = input(1, "To Month", minval=1, maxval=12), ToDay = input(1, "To Day", minval=1, maxval=31)
    FromDate = timestamp(FromYear, FromMonth, FromDay, 00, 00), ToDate = timestamp(ToYear, ToMonth, ToDay, 23, 59)
    TradeDateIsAllowed() => time >= FromDate and time <= ToDate
    l1Long = highest(l1LongInput)
    l1LongExit = lowest(l1LongExitInput)
    l2Long = highest(l2LongInput)
    l2LongExit = lowest(l2LongExitInput)
     
    bool win = false // tracks if last trade was winning trade of losing trade.
    float totalPrice = 0.0 // tracks total price, used for calculating avgPrice
    float buyPrice = 0.0 // tracks the buy price of the last long position.
    float avgPrice = 0.0 // tracks the avg price of all currently held long positions.
    float nextBuyPrice = 0.0 // tracks the next buy price
    float stopPrice = na // tracks the stop price
    int totalBuys = 0 // tracks the total # of pyramid buys
    bool inBuy = false // tracks if we are in a long position or not.
    float l1LongPlot = highest(l1LongInput) // tracks the L1 price to display
    float l2LongPlot = highest(l2LongInput) // tracks the L2 price to display
    float n = atr(14) // tracks the n used to calculate stops and pyramid buys
    string mode = 'L1' // tracks whether we are in a L1 position or L2 position.
    bool fake = na // tracks if this is a fake trade, see comments below.
    string longLevel = na // tracks where long positions, stops, pyramid buys occur.
     
    // by default use the last value from the previous bar.
    buyPrice := buyPrice[1]
    totalBuys := totalBuys[1]
    nextBuyPrice := nextBuyPrice[1]
    stopPrice := stopPrice[1]
    avgPrice := avgPrice[1]
    totalPrice := totalPrice[1]
    win := win[1]
     
    // State to track if we are in a long positon or not.
    inBuy := not inBuy[1] and (close > l1Long[1] or close > l2Long[1]) ? true : inBuy[1]
    inBuy := inBuy[1] and close < stopPrice ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L1' and close < l1LongExit[1] ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L2' and close < l2LongExit[1] ? false : inBuy
     
     
    // State to track if we are ia a fake trade. If the last trade was a winning, we need to skip the next trade.
    // We still track it though as a fake trade (not counted against us). as the outcome determines if we can
    // can take the next trade.
    fake := not inBuy[1] and close > l1Long[1] and win[1] ? true : fake[1]
    fake := not inBuy[1] and close > l1Long[1] and not win[1] ? false : fake
    fake := close > l2Long[1] ? false : fake
     
    // Series representing the l1 and l2 levels. If we break out above the l1 or l2 level, we want the
    // line to stay at the breakout level, not follow it up.
    l1LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l1Long[1],l1LongPlot[1])
    l2LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l2Long[1],l2LongPlot[1])
     
    // Variable in the series is only set when it happens. Possible values is L1, L2, SR
    // (stopped out with a loss), SG (exited with a gain), and 'P' for pyramid buy.
    longLevel := not inBuy[1] and close > l1Long[1] ? 'L1' : na
    longLevel := not inBuy[1] and close > l2Long[1] ? 'L2' : longLevel
    longLevel := not inBuy[1] and close > l1Long[1] and close > l2Long[1] and fake ? 'L2' : longLevel
    // longLevel := longLevel == na and close > l2Long[1] and mode[1] != 'L2' ? 'L2' : longLevel
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' ? na : longLevel // don't switch to L2 if we are already in a L1
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' and fake[1] ? 'L2' : longLevel
     
    // Either 'L1' or 'L2' depending on what breakout level we are in.
    mode := longLevel == na ? mode[1] : longLevel
     
    // Variables to track calculating avgPrice and nextBuyPrice for pyramiding.
    if longLevel == 'L1' or longLevel == 'L2'
    buyPrice = close
    totalBuys := 1
    totalPrice := close
    avgPrice := buyPrice
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Marks if we hit our next buy price, if so mark it with a 'P'
    longLevel := inBuy[1] and close > nextBuyPrice and TradeDateIsAllowed() and totalBuys < 5 ? 'P' : longLevel
     
    if longLevel == 'P'
    buyPrice = close
    totalBuys := totalBuys[1] + 1
    totalPrice := totalPrice[1] + buyPrice
    avgPrice := totalPrice / totalBuys
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Tracks stops and exits, marking them with SG or SR
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close < avgPrice ? 'SR' : longLevel
     
    // Tracks if the trade was a win or loss.
    win := longLevel == 'SG' ? true : win
    win := longLevel == 'SR' ? false : win
     
    // Variables used to tell strategy when to enter/exit trade.
    enterLong = (longLevel == 'L1' or longLevel == 'L2' or longLevel == 'P') and not fake and TradeDateIsAllowed()
    exitLong = (longLevel == 'SG' or longLevel == 'SR') and not fake and TradeDateIsAllowed()
     
    p1 = plot(l1LongPlot, title="l1 long", linewidth=3, style=plot.style_stepline, color=color.green)
    p2 = plot(l1LongExit[1], title="l1 exit", linewidth=3, style=plot.style_stepline, color=color.red)
    p3 = plot(l2LongPlot, title="l2 long", linewidth=2, style=plot.style_stepline, color=color.green)
    p4 = plot(l2LongExit[1], title="l2 exit", linewidth=2, style=plot.style_stepline, color=color.red)
    color1 = color.new(color.black, 0)
    color2 = color.new(color.black, 100)
    col= (inBuy) ? color1 : color2
    p5 = plot(stopPrice, title="stop", linewidth=2, style=plot.style_circles, join=true, color=col)
    p6 = plot(nextBuyPrice, title="next buy", linewidth=2, style=plot.style_circles, join=true, color=col)
     
    fill(p1, p3, color=color.green)
    fill(p2, p4, color=color.red)
     
    plotshape(longLevel == 'L1' and not fake ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape(fake and longLevel == 'L1' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape((mode == 'L2' or (mode == 'L1' and not fake)) and longLevel == 'P' ? true : false, color=color.green, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(mode == 'L1' and fake and longLevel == 'P' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(longLevel == 'L2' ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L2") // up arrow for entering L2 trade
     
    plotarrow(longLevel == 'L1' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L1 trade
    plotarrow(longLevel == 'L2' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L2 trade
    plotarrow(longLevel == 'SR' ? -1 : 0, colordown=color.red, colorup=color.purple, transp=40) // down arrow for losing trade
    plotarrow(longLevel == 'SG' ? -1 : 0, colordown=color.green, colorup=color.purple, transp=40) // down arrow for winning trade
     
    // plotarrow(win ? -1 : 0, colordown=color.yellow, colorup=color.purple, transp=40) // down arrow for winning trade
    // plotshape(inBuy[1], color=color.blue, transp=40, text='X') // down arrow for winning trade
    // label.new(bar_index, high, style=label.style_none, text=longLevel)
     
    alertcondition(low < stopPrice, title="crosses under stop price", message="price crossed under stop price")
    alertcondition(high > l1Long, title="crosses over L1 price", message="price crossed over L1 price")
    alertcondition(high > l2Long, title="crosses over L2 price", message="price crossed over L2 price")
    alertcondition(low < l1LongExit, title="crosses under L1 exit price", message="price crossed under L1 exit price")
    alertcondition(low < l2LongExit, title="crosses under L2 exit price", message="price crossed under L2 exit price")
     
    strategy.entry("long", strategy.long, comment='long', when=enterLong)
    strategy.close("long", when=exitLong)
     
    [/color][/i][/i][/b][/color][/color][/font][/font][/size]
  12. Like
    ⭐ VON KRIEGER reacted to candyman in AmiFeeder 5.63 - Amibroker Data Feed For Indian Market & MCX ( CRACKED )   
    are you working on the right program? this is just crypto=obfuscator.
    only thing is strings and flow obfuscation.
  13. Like
    ⭐ VON KRIEGER reacted to Shenong in AmiFeeder 5.63 - Amibroker Data Feed For Indian Market & MCX ( CRACKED )   
    Well, latest version of de4dot is below :
     
    https://github.com/de4dot/de4dot
     
    [h=1]Description[/h] de4dot is an open source (GPLv3) .NET deobfuscator and unpacker written in C#. It will try its best to restore a packed and obfuscated assembly to almost the original assembly. Most of the obfuscation can be completely restored (eg. string encryption), but symbol renaming is impossible to restore since the original names aren't (usually) part of the obfuscated assembly.
    It uses dnlib (https://github.com/0xd4d/dnlib/) to read and write assemblies so make sure you get it or it won't compile.
    [h=1] (https://github.com/de4dot/de4dot#binaries)[/h][h=1]Binaries[/h] Get binaries from the build server (https://github.com/0xd4d/de4dot/actions).
    [h=1] (https://github.com/de4dot/de4dot#its-free-but-theres-no-support)[/h][h=1]It's FREE but there's NO SUPPORT[/h] There's no support. Don't email me if you can't use it or if it fails to deobfuscate a file obfuscated with an updated obfuscator.
    Instead, try to update de4dot yourself. It's a lot easier than you think. If you can't, search the Internet and you should find a couple of forums where you can ask your question.
    [h=1] (https://github.com/de4dot/de4dot#features)[/h][h=1]Features[/h] Here's a pseudo random list of the things it will do depending on what obfuscator was used to obfuscate an assembly:
     

    Inline methods. Some obfuscators move small parts of a method to another static method and calls it.
    Decrypt strings statically or dynamically
    Decrypt other constants. Some obfuscators can also encrypt other constants, such as all integers, all doubles, etc.
    Decrypt methods statically or dynamically
    Remove proxy methods. Many obfuscators replace most/all call instructions with a call to a delegate. This delegate in turn calls the real method.
    Rename symbols. Even though most symbols can't be restored, it will rename them to human readable strings. Sometimes, some of the original names can be restored, though.
    Devirtualize virtualized code
    Decrypt resources. Many obfuscators have an option to encrypt .NET resources.
    Decrypt embedded files. Many obfuscators have an option to embed and possibly encrypt/compress other assemblies.
    Remove tamper detection code
    Remove anti-debug code
    Control flow deobfuscation. Many obfuscators modify the IL code so it looks like spaghetti code making it very difficult to understand the code.
    Restore class fields. Some obfuscators can move fields from one class to some other obfuscator created class.
    Convert a PE exe to a .NET exe. Some obfuscators wrap a .NET assembly inside a Win32 PE so a .NET decompiler can't read the file.
    Removes most/all junk classes added by the obfuscator.
    Fixes some peverify errors. Many of the obfuscators are buggy and create unverifiable code by mistake.
    Restore the types of method parameters and fields

    [h=1] (https://github.com/de4dot/de4dot#supported-obfuscatorspackers)[/h][h=1]Supported obfuscators/packers[/h]

    Agile.NET (aka CliSecure)
    Babel.NET
    CodeFort
    CodeVeil
    CodeWall
    CryptoObfuscator
    DeepSea Obfuscator
    Dotfuscator
    .NET Reactor
    Eazfuscator.NET
    Goliath.NET
    ILProtector
    MaxtoCode
    MPRESS
    Rummage
    Skater.NET
    SmartAssembly
    Spices.Net
    Xenocode

    Some of the above obfuscators are rarely used (eg. Goliath.NET), so they have had much less testing. Help me out by reporting bugs or problems you find.
    [h=1] (https://github.com/de4dot/de4dot#warning)[/h][h=1]Warning[/h] Sometimes the obfuscated assembly and all its dependencies are loaded into memory for execution. Use a safe sandbox environment if you suspect the assembly or assemblies to be malware.
    Even if the current version of de4dot doesn't load a certain assembly into memory for execution, a future version might.
    [h=1] (https://github.com/de4dot/de4dot#how-to-use-de4dot)[/h][h=1]How to use de4dot[/h] [h=2] (https://github.com/de4dot/de4dot#n00b-users)[/h][h=2]N00b users[/h] Drag and drop the file(s) onto de4dot.exe and wait a few seconds.
    [h=2] (https://github.com/de4dot/de4dot#deobfuscate-more-than-one-file-at-a-time)[/h][h=2]Deobfuscate more than one file at a time[/h] When more than one assembly has been obfuscated, it's very likely that you must deobfuscate them all at the same time unless you disable symbol renaming. The reason is that if assembly A has a reference to class C in assembly B, and you rename symbols only in assembly B, then class C could be renamed to eg. Class0 but the reference in assembly A still references a class called C in assembly B. If you deobfuscate both assemblies at the same time, all references will also be updated.
    [h=2] (https://github.com/de4dot/de4dot#find-all-obfuscated-files-and-deobfuscate-them)[/h][h=2]Find all obfuscated files and deobfuscate them[/h] The following command line will deobfuscate all assemblies that have been obfuscated by a supported obfuscator and save the assemblies to c:\output
    de4dot -r c:\input -ru -ro c:\output
    -r means recursive search. -ru means it should ignore unknown files. -ro means it should place the output files in the following directory. Typically, you'd first copy c:\input to c:\output, and then run the command. That way all the files will be in c:\output, even non-assemblies and non-processed assemblies. When de4dot is finished, you'd just double click the main assembly in c:\output and it should hopefully start.
    [h=2] (https://github.com/de4dot/de4dot#detect-obfuscator)[/h][h=2]Detect obfuscator[/h] Use the -d option to detect the obfuscator without deobfuscating any assembly.
    Find all .NET assemblies and detect obfuscator. If it's an unsupported obfuscator or if it's not obfuscated, it will print "Unknown obfuscator".
    de4dot -d -r c:\input
    Same as above except that it will only show which files have been obfuscated by a supported obfuscator.
    de4dot -d -r c:\input -ru
    Detect obfuscator
    de4dot -d file1.dll file2.dll file3.dll
    [h=2] (https://github.com/de4dot/de4dot#preserving-metadata-tokens)[/h][h=2]Preserving metadata tokens[/h] Sometimes in rare cases, you'd want to preserve the metadata tokens. Use --preserve-tokens or --preserve-table. Also consider using --keep-types since it won't remove any types and methods added by the obfuscator. Another useful option is --dont-create-params. If used, the renamer won't create Param rows for method parameters that don't have a Param row. That way the ParamPtr table won't be added to your assemblies. Peverify has a bug and doesn't support it (you'll see lots of "errors").
    The #Strings, #US and #Blob heaps can also be preserved by using --preserve-strings, --preserve-us, and --preserve-blob respectively. Of these three, --preserve-us is the most useful one since ldstr instruction and module.ResolveString() directly reference the #US heap.
    --preserve-sig-data should be used if the obfuscator adds extra data at the end of signatures that it uses for its own purpose, eg. as decryption keys. Confuser is one obfuscator that does this.
    --preserve-tokens preserves all important tokens but will also enable --preserve-us, --preserve-blob and --preserve-sig-data.
    If it's detected as an unknown (unsupported) obfuscator (or if you force it with -p un), all tokens are preserved, including the #US heap and any extra data at the end of signatures. Also, no obfuscator types, fields or methods are removed.
    Preserve all important tokens, #US, #Blob, extra sig data.
    de4dot --preserve-tokens file1.dll
    Preserve all important tokens, #US, #Blob, extra sig data and don't remove types/fields added by the obfuscator
    de4dot --keep-types --preserve-tokens file1.dll
    Preserve all important tokens, #US, #Blob, extra sig data and don't create extra Param rows to prevent the ParamPtr table from being created.
    de4dot --dont-create-params --preserve-tokens file1.dll
    Preserve all important tokens except the Param tokens.
    de4dot --preserve-table all,-pd file1.dll
    [h=2] (https://github.com/de4dot/de4dot#dynamically-decrypting-strings)[/h][h=2]Dynamically decrypting strings[/h] Although de4dot supports a lot of obfuscators, there's still some it doesn't support. To decrypt strings, you'll first need to figure out which method or methods decrypt strings. To get the method token of these string decrypters, you can use ILDASM with the 'show metadata tokens' option enabled. A method token is a 32-bit number and begins with 06, eg. 06012345.
    This command will load assembly file1.dll into memory by calling Assembly.Load(). When it detects calls to the two string decrypters (06012345 and 060ABCDE), it will call them by creating a dynamic method, and save the result (the decrypted string). The call to the string decrypter will be removed and the decrypted string will be in its place.
    de4dot file1.dll --strtyp delegate --strtok 06012345 --strtok 060ABCDE
    Since the assembly is loaded and executed, make sure you run this in a sandbox if you suspect the file to be malware.
    [h=2] (https://github.com/de4dot/de4dot#forcing-detection-of-a-certain-obfuscator)[/h][h=2]Forcing detection of a certain obfuscator[/h] de4dot isn't perfect. If it fails to detect an obfuscator, you can use the -p option to force it to assume it's been obfuscated by it.
    Force SmartAssembly
    de4dot file1.dll -p sa
    Force unsupported obfuscator
    de4dot file1.dll -p un
    For other obfuscator types, see the help screen.
    [h=2] (https://github.com/de4dot/de4dot#disabling-symbol-renaming)[/h][h=2]Disabling symbol renaming[/h] Renaming symbols isn't as easy as renaming A to B when reflection is involved. de4dot currently doesn't support renaming XAML so if you suspect that it uses WPF (or if it's a Silverlight app) you should disable renaming if the assembly fails to run.
    de4dot --dont-rename file1.dll file2.dll
    --keep-names can also be used to tell de4dot not to rename certain symbols, eg. "don't rename fields".
    Rename everything that should be renamed except properties, events and methods.
    de4dot --keep-names pem file1.dll
    [h=2] (https://github.com/de4dot/de4dot#using-a-different-rename-regex)[/h][h=2]Using a different rename regex[/h] The default regexes should be enough, except possibly the one that is used when an unsupported obfuscator is detected. To see all default regexes, start de4dot without any arguments and it will list all options and all default values.
    Eg., currently the following is the default regex used when Dotfuscator is detected
    !^[a-z][a-z0-9]{0,2}$&!^A_[0-9]+$&^[\u2E80-\u9FFFa-zA-Z_<{$][\u2E80-\u9FFFa-zA-Z_0-9<>{}$.`-]*$
    As you can see, it's not just one regex, it's more than one. Each one is separated by & and each regex can be negated by using ! in front of it. To show it more clearly, these regexes are used:
    (negated) ^[a-z][a-z0-9]{0,2}$
    (negated) ^A_[0-9]+$
    ^[\u2E80-\u9FFFa-zA-Z_<{$][\u2E80-\u9FFFa-zA-Z_0-9<>{}$.`-]*$
    To change the regex(es), you must know the short type name of the obfuscator (see help screen). Eg. it's sa if it's SmartAssembly, and un if it's an unsupported/unknown obfuscator. The option to use is --TYPE-name (eg. --sa-name for SmartAssembly and --un-name for unknown/unsupported obfuscators):
    de4dot --un-name "^[a-zA-Z]\w*$" file1.dll
    [h=2] (https://github.com/de4dot/de4dot#other-options)[/h][h=2]Other options[/h] Start de4dot without any arguments and it will show all options.
  14. Like
    ⭐ VON KRIEGER got a reaction from ⭐ Aurel88 in Break   
    Guys , pls avoid sending req to EDU this or that indicator.
    Currently I have educated many indicators (unfortunately thread for deleted) anyhow many of you have downloaded them.
     
    I'm planning to sit back and relax for 2 Month.
     
    Then I will educate the most demanding indicators including NextGen(90% work is already done) , Neurostreet Latest , Bell TPO 2021 S edition ( I'm waiting for setup but I should be able to get it soon), Ninja - Add-ons latest ( heard they are difficult so worth a try :P), MTPredictor latest(Thanks for setup Nadja) ( it's Easy to edu), Tieo One Trading , ,HPC , Also Optuma Enterprise Edition LATEST( already have it working but can't release due , crack is made by someone else I will seek her permission first)
     
    About forum is closing etc , I'm not exactly sure if forum(Indo-investasi) is gonna be shut down or now. For an alternative Admins can create Telegram Group or Better Discord Channel. I believe instead of any member creating it , if admins do it , it will be better. But that isn't necessary immediately once it's confirm that forum will be closed then admins can proceed with this plan.
     
    Now
    There is some hedge fund software PANOPTICON , I have received a request to educate this.. Somehow developer of this software is asking quite a hugeee amount.
    Although they provide Trial to hedge funds etc. I might be able to arrange their trial and perhaps educate it too , that will be a great gift to this communication, unfortunately it will be released for only HOF members.
     
     
    About other Reverse Engineers :-
    1)My Congratulations to Mateyboy , I have knows him from Reverse Engineers Forums , he is very dedicated to his work and it's great to see him break the Enigma Protections( Even I have to use help of LCT- Script or GGLoader to break till Enigma Version 5) , So it's a great achievement to break them without these tools.
     
    2)To RanjanAnand , I got all Bookmaps Add-ons also I have educated Bookmap Standalone) , Ping me on Telegram (you have my id) , I will forward them to you. Size is above 500mb so can't upload in temp upload sites.
     
    Also Great to see that you have BUILT YOUR OWN INDICATOR that is awesome and very helpful for beginners. So kudos on that :)
     
    If possible try educating Data Feeder like TrueData etc , indicators etc I will educate but server side education isn't my cup of tea.
    It will be great if you can educate data feeders.
     
    @Mateyboy, since you have crack Enigma , will it be possible for you to crack AligeDotNet? Let me know .
     
    Thanks all for reading this ( If you have read till end , you have my thanks :P)
  15. Like
    ⭐ VON KRIEGER got a reaction from melauf in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  16. Like
    ⭐ VON KRIEGER got a reaction from Galanoth in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  17. Like
    ⭐ VON KRIEGER got a reaction from Galanoth in Turtle Trading System (Strategy & Indicator)   
    PineScript :-
     
    //@version=4
    // To change this from a Strategy to a Indicator:-
    // 1) uncomment the next line and comment out the strategy line.
    // 2) at the end of the file comment out the last 2 lines
     
    // study(title="VonKrieger_Turtle_Indicator", overlay=true)
    strategy(title="VonKrieger_Turtle_Strategy", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1, pyramiding=5)
     
    stopInput = input(2.0, "Stop N", step=.5)
    pyramidInput = input(1, "Pyramid N", step=.5)
    l1LongInput = input(20, "L1 Long", minval=5)
    l2LongInput = input(55, "L2 Long", minval=5)
    l1LongExitInput = input (10, "L1 Long Exit", minval=5)
    l2LongExitInput = input (20, "L2 Long Exit", minval=5)
     
    FromYear = input(2000, "From Year", minval=1900), FromMonth = input(1, "From Month", minval=1, maxval=12), FromDay = input(1, "From Day", minval=1, maxval=31)
    ToYear = input(9999, "To Year", minval=1900), ToMonth = input(1, "To Month", minval=1, maxval=12), ToDay = input(1, "To Day", minval=1, maxval=31)
    FromDate = timestamp(FromYear, FromMonth, FromDay, 00, 00), ToDate = timestamp(ToYear, ToMonth, ToDay, 23, 59)
    TradeDateIsAllowed() => time >= FromDate and time <= ToDate
    l1Long = highest(l1LongInput)
    l1LongExit = lowest(l1LongExitInput)
    l2Long = highest(l2LongInput)
    l2LongExit = lowest(l2LongExitInput)
     
    bool win = false // tracks if last trade was winning trade of losing trade.
    float totalPrice = 0.0 // tracks total price, used for calculating avgPrice
    float buyPrice = 0.0 // tracks the buy price of the last long position.
    float avgPrice = 0.0 // tracks the avg price of all currently held long positions.
    float nextBuyPrice = 0.0 // tracks the next buy price
    float stopPrice = na // tracks the stop price
    int totalBuys = 0 // tracks the total # of pyramid buys
    bool inBuy = false // tracks if we are in a long position or not.
    float l1LongPlot = highest(l1LongInput) // tracks the L1 price to display
    float l2LongPlot = highest(l2LongInput) // tracks the L2 price to display
    float n = atr(14) // tracks the n used to calculate stops and pyramid buys
    string mode = 'L1' // tracks whether we are in a L1 position or L2 position.
    bool fake = na // tracks if this is a fake trade, see comments below.
    string longLevel = na // tracks where long positions, stops, pyramid buys occur.
     
    // by default use the last value from the previous bar.
    buyPrice := buyPrice[1]
    totalBuys := totalBuys[1]
    nextBuyPrice := nextBuyPrice[1]
    stopPrice := stopPrice[1]
    avgPrice := avgPrice[1]
    totalPrice := totalPrice[1]
    win := win[1]
     
    // State to track if we are in a long positon or not.
    inBuy := not inBuy[1] and (close > l1Long[1] or close > l2Long[1]) ? true : inBuy[1]
    inBuy := inBuy[1] and close < stopPrice ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L1' and close < l1LongExit[1] ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L2' and close < l2LongExit[1] ? false : inBuy
     
     
    // State to track if we are ia a fake trade. If the last trade was a winning, we need to skip the next trade.
    // We still track it though as a fake trade (not counted against us). as the outcome determines if we can
    // can take the next trade.
    fake := not inBuy[1] and close > l1Long[1] and win[1] ? true : fake[1]
    fake := not inBuy[1] and close > l1Long[1] and not win[1] ? false : fake
    fake := close > l2Long[1] ? false : fake
     
    // Series representing the l1 and l2 levels. If we break out above the l1 or l2 level, we want the
    // line to stay at the breakout level, not follow it up.
    l1LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l1Long[1],l1LongPlot[1])
    l2LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l2Long[1],l2LongPlot[1])
     
    // Variable in the series is only set when it happens. Possible values is L1, L2, SR
    // (stopped out with a loss), SG (exited with a gain), and 'P' for pyramid buy.
    longLevel := not inBuy[1] and close > l1Long[1] ? 'L1' : na
    longLevel := not inBuy[1] and close > l2Long[1] ? 'L2' : longLevel
    longLevel := not inBuy[1] and close > l1Long[1] and close > l2Long[1] and fake ? 'L2' : longLevel
    // longLevel := longLevel == na and close > l2Long[1] and mode[1] != 'L2' ? 'L2' : longLevel
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' ? na : longLevel // don't switch to L2 if we are already in a L1
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' and fake[1] ? 'L2' : longLevel
     
    // Either 'L1' or 'L2' depending on what breakout level we are in.
    mode := longLevel == na ? mode[1] : longLevel
     
    // Variables to track calculating avgPrice and nextBuyPrice for pyramiding.
    if longLevel == 'L1' or longLevel == 'L2'
    buyPrice = close
    totalBuys := 1
    totalPrice := close
    avgPrice := buyPrice
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Marks if we hit our next buy price, if so mark it with a 'P'
    longLevel := inBuy[1] and close > nextBuyPrice and TradeDateIsAllowed() and totalBuys < 5 ? 'P' : longLevel
     
    if longLevel == 'P'
    buyPrice = close
    totalBuys := totalBuys[1] + 1
    totalPrice := totalPrice[1] + buyPrice
    avgPrice := totalPrice / totalBuys
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Tracks stops and exits, marking them with SG or SR
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close < avgPrice ? 'SR' : longLevel
     
    // Tracks if the trade was a win or loss.
    win := longLevel == 'SG' ? true : win
    win := longLevel == 'SR' ? false : win
     
    // Variables used to tell strategy when to enter/exit trade.
    enterLong = (longLevel == 'L1' or longLevel == 'L2' or longLevel == 'P') and not fake and TradeDateIsAllowed()
    exitLong = (longLevel == 'SG' or longLevel == 'SR') and not fake and TradeDateIsAllowed()
     
    p1 = plot(l1LongPlot, title="l1 long", linewidth=3, style=plot.style_stepline, color=color.green)
    p2 = plot(l1LongExit[1], title="l1 exit", linewidth=3, style=plot.style_stepline, color=color.red)
    p3 = plot(l2LongPlot, title="l2 long", linewidth=2, style=plot.style_stepline, color=color.green)
    p4 = plot(l2LongExit[1], title="l2 exit", linewidth=2, style=plot.style_stepline, color=color.red)
    color1 = color.new(color.black, 0)
    color2 = color.new(color.black, 100)
    col= (inBuy) ? color1 : color2
    p5 = plot(stopPrice, title="stop", linewidth=2, style=plot.style_circles, join=true, color=col)
    p6 = plot(nextBuyPrice, title="next buy", linewidth=2, style=plot.style_circles, join=true, color=col)
     
    fill(p1, p3, color=color.green)
    fill(p2, p4, color=color.red)
     
    plotshape(longLevel == 'L1' and not fake ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape(fake and longLevel == 'L1' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape((mode == 'L2' or (mode == 'L1' and not fake)) and longLevel == 'P' ? true : false, color=color.green, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(mode == 'L1' and fake and longLevel == 'P' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(longLevel == 'L2' ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L2") // up arrow for entering L2 trade
     
    plotarrow(longLevel == 'L1' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L1 trade
    plotarrow(longLevel == 'L2' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L2 trade
    plotarrow(longLevel == 'SR' ? -1 : 0, colordown=color.red, colorup=color.purple, transp=40) // down arrow for losing trade
    plotarrow(longLevel == 'SG' ? -1 : 0, colordown=color.green, colorup=color.purple, transp=40) // down arrow for winning trade
     
    // plotarrow(win ? -1 : 0, colordown=color.yellow, colorup=color.purple, transp=40) // down arrow for winning trade
    // plotshape(inBuy[1], color=color.blue, transp=40, text='X') // down arrow for winning trade
    // label.new(bar_index, high, style=label.style_none, text=longLevel)
     
    alertcondition(low < stopPrice, title="crosses under stop price", message="price crossed under stop price")
    alertcondition(high > l1Long, title="crosses over L1 price", message="price crossed over L1 price")
    alertcondition(high > l2Long, title="crosses over L2 price", message="price crossed over L2 price")
    alertcondition(low < l1LongExit, title="crosses under L1 exit price", message="price crossed under L1 exit price")
    alertcondition(low < l2LongExit, title="crosses under L2 exit price", message="price crossed under L2 exit price")
     
    strategy.entry("long", strategy.long, comment='long', when=enterLong)
    strategy.close("long", when=exitLong)
     
    [/color][/i][/i][/b][/color][/color][/font][/font][/size]
  18. Like
    ⭐ VON KRIEGER got a reaction from scorpionidain in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  19. Like
    ⭐ VON KRIEGER got a reaction from ⭐ chullankallan in Turtle Trading System (Strategy & Indicator)   
    try this one https://pastebin.com/X2ukucc2
  20. Like
    ⭐ VON KRIEGER got a reaction from ⭐ btul in Trading View Pine Coders?   
    Hello Boys/Girls,
     
    First of all my heart full thanks admin , Jane- Trader Beauty for accepting my request and create this section.
     
    This is just to collect like mind together who have knowledge of pine scripts.
     
    I'm personally learning it and I'm impressed with this language and possibly it can offer. (Especially after introduction of ARRAY)
     
    Anyways , I have coded few indicators which I will release public shortly.
     
    And currently I'm working on some indicator and I would love if you guys have Good idea for any setup or any system then we can try to built it together.
     
    It's like latest Episode of DuckTales ( 12th march 2021) , If you have any idea we can Gizmo it .
  21. Like
    ⭐ VON KRIEGER got a reaction from Rhodan909 in Warrior Pro Trading System - Warrior Trading   
    Can anyone upload only 2020 update videos. Thanks
  22. Like
    ⭐ VON KRIEGER reacted to ⭐ A.L.T in Turtle Trading System (Strategy & Indicator)   
    compile error:
    line 82: Mismatched input 'buyPrice' expecting 'end of line without line continuation'.
     

  23. Like
    ⭐ VON KRIEGER got a reaction from ⭐ chullankallan in Turtle Trading System (Strategy & Indicator)   
    PineScript :-
     
    //@version=4
    // To change this from a Strategy to a Indicator:-
    // 1) uncomment the next line and comment out the strategy line.
    // 2) at the end of the file comment out the last 2 lines
     
    // study(title="VonKrieger_Turtle_Indicator", overlay=true)
    strategy(title="VonKrieger_Turtle_Strategy", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1, pyramiding=5)
     
    stopInput = input(2.0, "Stop N", step=.5)
    pyramidInput = input(1, "Pyramid N", step=.5)
    l1LongInput = input(20, "L1 Long", minval=5)
    l2LongInput = input(55, "L2 Long", minval=5)
    l1LongExitInput = input (10, "L1 Long Exit", minval=5)
    l2LongExitInput = input (20, "L2 Long Exit", minval=5)
     
    FromYear = input(2000, "From Year", minval=1900), FromMonth = input(1, "From Month", minval=1, maxval=12), FromDay = input(1, "From Day", minval=1, maxval=31)
    ToYear = input(9999, "To Year", minval=1900), ToMonth = input(1, "To Month", minval=1, maxval=12), ToDay = input(1, "To Day", minval=1, maxval=31)
    FromDate = timestamp(FromYear, FromMonth, FromDay, 00, 00), ToDate = timestamp(ToYear, ToMonth, ToDay, 23, 59)
    TradeDateIsAllowed() => time >= FromDate and time <= ToDate
    l1Long = highest(l1LongInput)
    l1LongExit = lowest(l1LongExitInput)
    l2Long = highest(l2LongInput)
    l2LongExit = lowest(l2LongExitInput)
     
    bool win = false // tracks if last trade was winning trade of losing trade.
    float totalPrice = 0.0 // tracks total price, used for calculating avgPrice
    float buyPrice = 0.0 // tracks the buy price of the last long position.
    float avgPrice = 0.0 // tracks the avg price of all currently held long positions.
    float nextBuyPrice = 0.0 // tracks the next buy price
    float stopPrice = na // tracks the stop price
    int totalBuys = 0 // tracks the total # of pyramid buys
    bool inBuy = false // tracks if we are in a long position or not.
    float l1LongPlot = highest(l1LongInput) // tracks the L1 price to display
    float l2LongPlot = highest(l2LongInput) // tracks the L2 price to display
    float n = atr(14) // tracks the n used to calculate stops and pyramid buys
    string mode = 'L1' // tracks whether we are in a L1 position or L2 position.
    bool fake = na // tracks if this is a fake trade, see comments below.
    string longLevel = na // tracks where long positions, stops, pyramid buys occur.
     
    // by default use the last value from the previous bar.
    buyPrice := buyPrice[1]
    totalBuys := totalBuys[1]
    nextBuyPrice := nextBuyPrice[1]
    stopPrice := stopPrice[1]
    avgPrice := avgPrice[1]
    totalPrice := totalPrice[1]
    win := win[1]
     
    // State to track if we are in a long positon or not.
    inBuy := not inBuy[1] and (close > l1Long[1] or close > l2Long[1]) ? true : inBuy[1]
    inBuy := inBuy[1] and close < stopPrice ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L1' and close < l1LongExit[1] ? false : inBuy
    inBuy := inBuy[1] and mode[1] == 'L2' and close < l2LongExit[1] ? false : inBuy
     
     
    // State to track if we are ia a fake trade. If the last trade was a winning, we need to skip the next trade.
    // We still track it though as a fake trade (not counted against us). as the outcome determines if we can
    // can take the next trade.
    fake := not inBuy[1] and close > l1Long[1] and win[1] ? true : fake[1]
    fake := not inBuy[1] and close > l1Long[1] and not win[1] ? false : fake
    fake := close > l2Long[1] ? false : fake
     
    // Series representing the l1 and l2 levels. If we break out above the l1 or l2 level, we want the
    // line to stay at the breakout level, not follow it up.
    l1LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l1Long[1],l1LongPlot[1])
    l2LongPlot := iff(not inBuy or (inBuy and mode == 'L1' and fake),l2Long[1],l2LongPlot[1])
     
    // Variable in the series is only set when it happens. Possible values is L1, L2, SR
    // (stopped out with a loss), SG (exited with a gain), and 'P' for pyramid buy.
    longLevel := not inBuy[1] and close > l1Long[1] ? 'L1' : na
    longLevel := not inBuy[1] and close > l2Long[1] ? 'L2' : longLevel
    longLevel := not inBuy[1] and close > l1Long[1] and close > l2Long[1] and fake ? 'L2' : longLevel
    // longLevel := longLevel == na and close > l2Long[1] and mode[1] != 'L2' ? 'L2' : longLevel
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' ? na : longLevel // don't switch to L2 if we are already in a L1
    longLevel := longLevel == na and close > l2Long[1] and mode[1] == 'L1' and fake[1] ? 'L2' : longLevel
     
    // Either 'L1' or 'L2' depending on what breakout level we are in.
    mode := longLevel == na ? mode[1] : longLevel
     
    // Variables to track calculating avgPrice and nextBuyPrice for pyramiding.
    if longLevel == 'L1' or longLevel == 'L2'
    buyPrice = close
    totalBuys := 1
    totalPrice := close
    avgPrice := buyPrice
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Marks if we hit our next buy price, if so mark it with a 'P'
    longLevel := inBuy[1] and close > nextBuyPrice and TradeDateIsAllowed() and totalBuys < 5 ? 'P' : longLevel
     
    if longLevel == 'P'
    buyPrice = close
    totalBuys := totalBuys[1] + 1
    totalPrice := totalPrice[1] + buyPrice
    avgPrice := totalPrice / totalBuys
    stopPrice := close - (stopInput*n)
    nextBuyPrice := high + (pyramidInput*n)
     
    // Tracks stops and exits, marking them with SG or SR
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and inBuy[1] and close < stopPrice and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close >= avgPrice ? 'SG' : longLevel
    longLevel := longLevel == na and mode[1] == 'L1' and inBuy[1] and (close < l1LongExit[1]) and close < avgPrice ? 'SR' : longLevel
    longLevel := longLevel == na and mode[1] == 'L2' and inBuy[1] and (close < l2LongExit[1]) and close < avgPrice ? 'SR' : longLevel
     
    // Tracks if the trade was a win or loss.
    win := longLevel == 'SG' ? true : win
    win := longLevel == 'SR' ? false : win
     
    // Variables used to tell strategy when to enter/exit trade.
    enterLong = (longLevel == 'L1' or longLevel == 'L2' or longLevel == 'P') and not fake and TradeDateIsAllowed()
    exitLong = (longLevel == 'SG' or longLevel == 'SR') and not fake and TradeDateIsAllowed()
     
    p1 = plot(l1LongPlot, title="l1 long", linewidth=3, style=plot.style_stepline, color=color.green)
    p2 = plot(l1LongExit[1], title="l1 exit", linewidth=3, style=plot.style_stepline, color=color.red)
    p3 = plot(l2LongPlot, title="l2 long", linewidth=2, style=plot.style_stepline, color=color.green)
    p4 = plot(l2LongExit[1], title="l2 exit", linewidth=2, style=plot.style_stepline, color=color.red)
    color1 = color.new(color.black, 0)
    color2 = color.new(color.black, 100)
    col= (inBuy) ? color1 : color2
    p5 = plot(stopPrice, title="stop", linewidth=2, style=plot.style_circles, join=true, color=col)
    p6 = plot(nextBuyPrice, title="next buy", linewidth=2, style=plot.style_circles, join=true, color=col)
     
    fill(p1, p3, color=color.green)
    fill(p2, p4, color=color.red)
     
    plotshape(longLevel == 'L1' and not fake ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape(fake and longLevel == 'L1' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text="L1") // up arrow for entering L1 trade
    plotshape((mode == 'L2' or (mode == 'L1' and not fake)) and longLevel == 'P' ? true : false, color=color.green, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(mode == 'L1' and fake and longLevel == 'P' ? true : false, color=color.gray, transp=40, style=shape.triangleup, text='P') // up arrow for entering L1 trade
    plotshape(longLevel == 'L2' ? true : false, color=color.green, transp=40, style=shape.triangleup, text="L2") // up arrow for entering L2 trade
     
    plotarrow(longLevel == 'L1' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L1 trade
    plotarrow(longLevel == 'L2' ? 1 : 0, colordown=color.black, colorup=color.green, transp=40) // up arrow for entering L2 trade
    plotarrow(longLevel == 'SR' ? -1 : 0, colordown=color.red, colorup=color.purple, transp=40) // down arrow for losing trade
    plotarrow(longLevel == 'SG' ? -1 : 0, colordown=color.green, colorup=color.purple, transp=40) // down arrow for winning trade
     
    // plotarrow(win ? -1 : 0, colordown=color.yellow, colorup=color.purple, transp=40) // down arrow for winning trade
    // plotshape(inBuy[1], color=color.blue, transp=40, text='X') // down arrow for winning trade
    // label.new(bar_index, high, style=label.style_none, text=longLevel)
     
    alertcondition(low < stopPrice, title="crosses under stop price", message="price crossed under stop price")
    alertcondition(high > l1Long, title="crosses over L1 price", message="price crossed over L1 price")
    alertcondition(high > l2Long, title="crosses over L2 price", message="price crossed over L2 price")
    alertcondition(low < l1LongExit, title="crosses under L1 exit price", message="price crossed under L1 exit price")
    alertcondition(low < l2LongExit, title="crosses under L2 exit price", message="price crossed under L2 exit price")
     
    strategy.entry("long", strategy.long, comment='long', when=enterLong)
    strategy.close("long", when=exitLong)
     
    [/color][/i][/i][/b][/color][/color][/font][/font][/size]
  24. Like
    ⭐ VON KRIEGER got a reaction from ivan2007007 in Trading View Pine Coders?   
    Yes.. actually array is a container object that holds a fixed number of values of a single type..
  25. Like
    ⭐ VON KRIEGER got a reaction from ivan2007007 in Trading View Pine Coders?   
    Hello Boys/Girls,
     
    First of all my heart full thanks admin , Jane- Trader Beauty for accepting my request and create this section.
     
    This is just to collect like mind together who have knowledge of pine scripts.
     
    I'm personally learning it and I'm impressed with this language and possibly it can offer. (Especially after introduction of ARRAY)
     
    Anyways , I have coded few indicators which I will release public shortly.
     
    And currently I'm working on some indicator and I would love if you guys have Good idea for any setup or any system then we can try to built it together.
     
    It's like latest Episode of DuckTales ( 12th march 2021) , If you have any idea we can Gizmo it .
×
×
  • Create New...