This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
strategy("Donchian Breakout Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.045) | |
// === Inputs === | |
entryLen = input.int(20, "Donchian Entry Length", minval=1) | |
exitLen = input.int(10, "Donchian Exit Length", minval=1) | |
atrLength = input.int(14, "ATR Length", minval=1) | |
atrMult = input.float(1.5, "ATR Stop Multiplier", minval=0.1) | |
emaLen = input.int(50, "EMA Trend Filter Length") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
strategy("NakInvest - 123 Strategy (Full Control)", overlay=true, | |
default_qty_type=strategy.percent_of_equity, | |
default_qty_value=1, | |
commission_type=strategy.commission.percent, | |
commission_value=0.045) | |
// === INPUTS === | |
// Pattern | |
minBodyRatio = input.float(0.7, "Min Body Size Ratio (Candle 3 vs 1)", minval=0.1, group="123 Pattern") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
indicator("NakInvest - PFR Identifier", overlay=true) | |
// === PFR CONDITIONS === | |
reversalBody = math.abs(close - open) | |
prevBody1 = math.abs(close[1] - open[1]) | |
prevBody2 = math.abs(close[2] - open[2]) | |
bullishCandle = close > open | |
bearishCandle = close < open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
strategy("NakInvest - PFR Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10) | |
// === INPUTS === | |
shortEmaLength = input.int(9, title="Short EMA Length") | |
longEmaLength = input.int(100, title="Long EMA Length") | |
stochLength = input.int(8, title="Stochastic Length") | |
stochK = input.int(3, title="Stoch %K Smoothing") | |
stochD = input.int(3, title="Stoch %D Smoothing") | |
rsiLength = input.int(8, title="RSI Length") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
indicator("NakInvest - Bullish Candlestick Patterns", overlay=true) | |
// Function to identify a Hammer pattern | |
isHammer() => | |
lowerShadow = low < close - (high - low) * 0.5 | |
upperShadow = high - close < (high - low) * 0.1 | |
bodySize = math.abs(close - open) | |
bodySize < (high - low) * 0.3 and lowerShadow and upperShadow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=5 | |
indicator("NakInvest - Bullish Candlestick Patterns with Doji", overlay=true) | |
// Function to identify a Hammer pattern | |
isHammer() => | |
lowerShadow = low < close - (high - low) * 0.5 | |
upperShadow = high - close < (high - low) * 0.1 | |
bodySize = math.abs(close - open) | |
bodySize < (high - low) * 0.3 and lowerShadow and upperShadow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.conf.Configuration | |
import org.apache.iceberg.hadoop.HadoopFileIO | |
import org.apache.iceberg.spark.Spark3Util | |
import org.apache.iceberg.{DataFile, Snapshot, TableProperties, Table => IcebergTable} | |
import org.apache.spark.SparkConf | |
import org.apache.spark.sql.functions._ | |
import org.apache.spark.sql.types.{StringType, StructField, StructType, TimestampType} | |
import org.apache.spark.sql.{DataFrame, Row, SparkSession} | |
import org.junit.runner.RunWith | |
import org.scalatest.BeforeAndAfterAll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.conf.Configuration | |
import org.apache.iceberg.hadoop.HadoopFileIO | |
import org.apache.iceberg.spark.Spark3Util | |
import org.apache.iceberg.{DataFile, PartitionSpec, Schema, Snapshot, TableMetadata, TableMetadataParser, Table => IcebergTable} | |
import org.apache.spark.SparkConf | |
import org.apache.spark.sql.functions._ | |
import org.apache.spark.sql.types.{StringType, StructField, StructType, TimestampType} | |
import org.apache.spark.sql.{DataFrame, Row, SparkSession} | |
import org.junit.runner.RunWith | |
import org.scalatest.BeforeAndAfterAll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turtle | |
import random | |
t = turtle.Turtle() | |
scorey = turtle.Turtle() | |
score = 0 | |
t.goto(0,0) | |
scorey.penup() | |
scorey.goto(200,200) | |
t.setheading(90) | |
c = turtle.Turtle() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type" : "record", | |
"name" : "twitter_schema", | |
"namespace" : "foo.bar", | |
"fields" : [ { | |
"name" : "username", | |
"type" : "string", | |
"doc" : "Name of the user account on Twitter.com" | |
}, { | |
"name" : "tweet", |
NewerOlder