Set Bitcoin Price and Push Notifications Via WeChat Rounded Hundred Break Push
Teaching Strategies: When the price is an integer of 100, WeChat pushes a notification, which outputs an array containing 10 elements. Prefer locking the data in the current range Polling whether the data crosses…
Teaching Strategies: When the price is an integer of 100, WeChat pushes a notification, which outputs an array containing 10 elements.
Prefer locking the data in the current range Polling whether the data crosses this range Above this interval is an upward breakthrough. Compare with the previous trigger data. If different, record it. Above this range is a downward breakout, and it should be compared with the data from the previous trigger. If different, record it. Note, there is a 100 range that needs to be added here because they all fall into the bottom integer range. Array Shift Forward Loop
Parameters
| Name | Default | What it controls |
|---|---|---|
| Interval | true | interval |
Source JavaScript
/*backtest
start: 2020-10-13 00:00:00
end: 2020-10-14 01:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"OKEX","currency":"BTC_USDT"}]
*/
var a=[1,2,3,4,5,6,7,8,9,10]
var ticker= _C(exchange.GetTicker)
function lock(){ //Lock the current price in which integer range
P=parseInt(ticker.Last/100)*100
HP=P+100
lock_tickLast=ticker.Last
// Log(P,HP,ticker.Last)
}
function stack(){
for(var k=0;k<a.length;k++)
a[k]=a[k+1]
}
function onTick(){
ticker = _C(exchange.GetTicker)
var get=parseInt(ticker.Last/100)*100
if(get>P){
a[9]=get
if(a[8]!=a[9]){
str=a.toString()
if(a[9]-a[8]>100)
Log("Successful upward gap breakthrough",get,ticker.Last,"{",str,"}",'@')
else
Log("Successful breakthrough upward",get,ticker.Last,"{",str,"}",'@' )
lock()
stack()
}
}
else if(get<P){
a[9]=get+100
if(a[9]!=a[8]){
str=a.toString()
if(a[8]-a[9]>100)
Log("Successful downward gap breakthrough",a[9],ticker.Last,"{",str,"}",'@')
else
Log("Successfully broke downward",a[9],ticker.Last,"{",str,"}",'@' )
lock()
stack()
}
}
}
function main(){
lock()
a[8]=P
// var ticker=0
Log("The program runs and starts pushing",ticker.Last,'@')
while(true){
onTick()
Sleep(Interval*1000)
}
}
Published by FMZ_JH on the FMZ strategy square · last modified 2020-10-29. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Set-Bitcoin-Price-and-Push-Notifications-Via-WeChat-Rounded-Hundred-Break-Push.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Moving Average BreakthroughJavaScript · Breakout · 1d
- Turtle Quantitative Tool Original Turtle E Ratio CalculationJavaScript · Breakout · 1d
- Turtle Soup Strategy Counter Trend Trading StrategyJavaScript · Breakout
- 5 Day Moving Average Channel Breakout Strategy Combined With Mileage ConceptPine Script · Breakout · 1d
- ATR Trailing Stops StrategyPine Script · Breakout · 1h
- ATR Trend Breakout StrategyPine Script · Breakout · 1d