一身仙ぐ女味

文章 评论 浏览 27

一身仙ぐ女味 2025-02-12 21:00:03

有很多方法可以解决这个问题。 @DB和@stuupid的列表理解是一种紧凑的方法,但是如果您只是开始使用Python,可能会有些混乱。

所有技术都归结为以某种方式迭代列表。让我们从您的列表开始。我将列表中的所有项目更改为字符串,因为这是我认为您确实想要

list1 = ['super', 'cool', 'huge']
list2 = ['dog', 'cat', 'mouse']

通过列表迭代的最常见方法可能是 for loop 。您可以

for item in list1:
    print(item)

ranga

super
cool
huge

使用 用于循环的通用构造:

for i in range(3):
    print(i)

可以使

0
1
2

您可以将range()与 len( )获得列表的索引

for i in range(len(list1)):
    print(i)

回到

0
1
2

您的问题。我们可以使用范围(Len())技巧逐步浏览List1的索引并即时填写新列表:

list1 = ['super', 'cool', 'huge']
list2 = ['dog', 'cat', 'mouse']
list3 = []    # new empty list

for i in range(len(list1)):
    list3.append(list1[i] + list2[i])

print(list3)

这给出了

['superdog', 'coolcat', 'hugemouse']

解决此问题的非常基本的方法,并且它利用了<代码的事实。 > list1 和 list2 具有相同数量的项目。解决问题的一种更安全的方法是在列表之间进行一些Len()比较,以确保它们的长度相同。

There are many ways to solve this problem. The list comprehension from @d.b and @stuupid is a compact way to do it, but might be a little confusing if you're just getting started in Python.

All of the techniques boil down to somehow iterating through a list. Let's start with your lists. I changed all of the items inside your lists to strings, since that's what I think you really wanted

list1 = ['super', 'cool', 'huge']
list2 = ['dog', 'cat', 'mouse']

The most common way to iterate through a list might be with a for loop. You can do

for item in list1:
    print(item)

which gives

super
cool
huge

using the range function is a very common construct for a for loop:

for i in range(3):
    print(i)

which gives

0
1
2

You can combine range() with len() to get the indexes of a list:

for i in range(len(list1)):
    print(i)

gives

0
1
2

Getting back to your problem. We can use the range(len()) trick to step through the indices of list1 and fill in a new list on the fly:

list1 = ['super', 'cool', 'huge']
list2 = ['dog', 'cat', 'mouse']
list3 = []    # new empty list

for i in range(len(list1)):
    list3.append(list1[i] + list2[i])

print(list3)

which gives

['superdog', 'coolcat', 'hugemouse']

This is a very basic way to approach this problem and it takes advantage of the fact that list1 and list2 have the same number of items. A safer way to solve the problem would be to do some len() comparisons between the lists to make sure they are the same length.

将两个列表添加在一起,每个列表的开始都将添加到另一个列表

一身仙ぐ女味 2025-02-12 11:54:41

如果您的Mariadb可以使用您的设置运行,请执行“ Docker Exec”以在MariaDB容器内运行bash,并检查您的音量安装是否在预期的位置显示了预期的文件。

然后,还要检查容器内部的MariaDB的配置或启动是否完全读取这些文件。您可以通过提供空的文件或内部有gibberish的文件来做到这一点。

只有然后开始查看文件的内容。到达这里后,您似乎对容器化的数据库引擎具有电源。

If your MariaDB can run with your settings, perform 'docker exec' to run a bash inside your MariaDB container and check if your volume mount shows the expected files in the expected location.

Then also check that the configuation or startup of MariaDB inside the container is configured to read these files at all. You could to that by providing empty files, or files with gibberish inside.

Only then start looking at the content of the files. Once you reach here, you seem to have power over the containerized database engine.

Docker容器未使用的MariaDB配置

一身仙ぐ女味 2025-02-12 10:08:14

类ModelPackage仅接收一个字符串作为ARN。您必须在模型注册表上创建一个新的模型基础,然后使用类模型执行转换

the class ModelPackage only receives a String as an ARN. You have to create a new model base on the model registry and then use the class model to perform a transformation

从SageMaker管道中的模型注册表中检索萨吉式制造商模型

一身仙ぐ女味 2025-02-12 05:49:24

您可以尝试将文件从传出更改集移回未解决的

使用文件更改上的“撤消”操作将其从更改集中删除并将其恢复为较早的状态。

You could try and move a file from outgoing changeset back to unresolved

Use the "Undo" action on the file change to remove it from the change set and revert it to an earlier state.

在RTC更改集中撤消办理登机手续

一身仙ぐ女味 2025-02-11 20:51:31

Postman不支持在UDP上发送。

Postman doesn't support sending on UDP.

我如何要求邮递员的骆驼封闭式端点?

一身仙ぐ女味 2025-02-11 16:08:27

您可以尝试

out = df.filter(regex='(NAME|EMAIL)_[12]')

如果后缀不同,

out = df.filter(regex='(NAME_[12]|EMAIL_[3-5])')

You can try

out = df.filter(regex='(NAME|EMAIL)_[12]')

If suffix is different

out = df.filter(regex='(NAME_[12]|EMAIL_[3-5])')

如何用ake过滤几列并遵循序列?

一身仙ぐ女味 2025-02-09 18:13:56

>从fastapi-pagination中只是一个小型助手类,它为您带来了一些流行:

class Params(BaseModel, AbstractParams):
    page: int = Query(1, ge=1, description="Page number")
    size: int = Query(50, ge=1, le=100, description="Page size")

    def to_raw_params(self) -> RawParams:
        return RawParams(
            limit=self.size,
            offset=self.size * (self.page - 1),
        )

您可以使用它,而不是明确地将这些参数传递到您的端点。

This Params from fastapi-pagination is just a small helper class, that does some prevalidation for you:

class Params(BaseModel, AbstractParams):
    page: int = Query(1, ge=1, description="Page number")
    size: int = Query(50, ge=1, le=100, description="Page size")

    def to_raw_params(self) -> RawParams:
        return RawParams(
            limit=self.size,
            offset=self.size * (self.page - 1),
        )

You can use it instead of explicitly passing those parameters to your endpoint.

如何通过查询设置Paginate参数?

一身仙ぐ女味 2025-02-08 08:41:20

当前订阅的方式是使用更多的 rxjs operators ,您所关注的教程似乎有点少。我建议您关注Angular的英雄之旅教程。它始终是最新的。

这应该让您前进:

this.http
    .get('http://localhost:8080/api/user')
    .pipe(
        catchError(err => {
            console.log(err);
        })
    )
    .subscribe(data => {
        this.visiteur = `${data.nom}`;
    });

我也建议您实现 angular noreferrer“> angular http Interpector在HTTP中,需要属性/标题(在您的情况下使用credentials)。但这对于这个问题的范围是可选的。

最后,别忘了避免内存 - 裂变带有订阅的陷阱。

The current way of subscribing is using more of rxjs operators, The tutorial you are following seems a little outdated. I recommend you follow angular's Tour of heroes tutorial instead. It is always up-to-date.

This should get you going:

this.http
    .get('http://localhost:8080/api/user')
    .pipe(
        catchError(err => {
            console.log(err);
        })
    )
    .subscribe(data => {
        this.visiteur = `${data.nom}`;
    });

Also I would recommend you implement an angular http interceptor to pass in http required attributes/headers (in your case withCredentials). But this is optional for the scope of this question.

And finally, don't forget to avoid the memory-leak trap with subscriptions.

由于订阅(Angular)而无法使用res.name

一身仙ぐ女味 2025-02-07 13:46:26

您将无法以这种方式重定向到页面,您将返回响应的主体。您不得在方法签名中包含@Responseboby,以便Spring知道它应该寻找页面。

您的方法需要类似:

@RequestMapping(value="/authentification", method= RequestMethod.POST)
public String logData(LoginForm lgf){
    if(diaDao.loggin(lgf.getMail(), lgf.getMdp()))
        return "page_name";
    else
        return "page_name";

}

您还可以使用ModelAndView将其重定向到页面,并且仍将数据发送到页面。因此:

@RequestMapping(value="/authentification", method= RequestMethod.POST)
public ModelAndView logData(LoginForm lgf){
    ModelAndView mv = new ModelAndView("page_name1");
    if(diaDao.loggin(lgf.getMail(), lgf.getMdp())) {
        mv.addObject("objectX", "objectValueX");
    } else {
        mv.setViewName("page_name2");
        mv.addObject("objectY", "objectValueY");
    }
    return mv;
}

you won't be able to redirect to a page this way, you're returning the body of a response. you must not include @ResponseBody in the method signature, so that spring understands that it should look for a page.

your method needs to be like:

@RequestMapping(value="/authentification", method= RequestMethod.POST)
public String logData(LoginForm lgf){
    if(diaDao.loggin(lgf.getMail(), lgf.getMdp()))
        return "page_name";
    else
        return "page_name";

}

you can also use ModelAndView to redirect to a page and still send data to the page. thus:

@RequestMapping(value="/authentification", method= RequestMethod.POST)
public ModelAndView logData(LoginForm lgf){
    ModelAndView mv = new ModelAndView("page_name1");
    if(diaDao.loggin(lgf.getMail(), lgf.getMdp())) {
        mv.addObject("objectX", "objectValueX");
    } else {
        mv.setViewName("page_name2");
        mv.addObject("objectY", "objectValueY");
    }
    return mv;
}

Spring Boot MVC:如何重定向到视图

一身仙ぐ女味 2025-02-07 08:38:25

不要像我想要的那样工作。

修改在MA基线中犯了一个错误。

这是完整的代码。

谢谢,

//@version=4
//By Mihkel00
// This script is designed for the NNFX Method, so it is recommended for Daily charts only. 
// Tried to implement a few VP NNFX Rules
// This script has a SSL / Baseline (you can choose between the SSL or MA), a secondary SSL for continiuation trades and a third SSL for exit trades.
// Alerts added for Baseline entries, SSL2 continuations, Exits.
// Baseline has a Keltner Channel setting for "in zone" Gray Candles
// Added "Candle Size > 1 ATR" Diamonds from my old script with the criteria of being within Baseline ATR range.
// Credits
// Strategy causecelebre https://www.tradingview.com/u/causecelebre/
// SSL Channel ErwinBeckers https://www.tradingview.com/u/ErwinBeckers/
// Moving Averages jiehonglim https://www.tradingview.com/u/jiehonglim/
// Moving Averages  everget https://www.tradingview.com/u/everget/
// "Many Moving Averages" script  Fractured https://www.tradingview.com/u/Fractured/
study("SSL Hybrid", overlay=true)
show_Baseline = input(title="Show Baseline", type=input.bool, defval=true)
show_SSL1 = input(title="Show SSL1", type=input.bool, defval=false)
show_atr = input(title="Show ATR bands", type=input.bool, defval=true)
//ATR
atrlen = input(14, "ATR Period")
mult = input(1, "ATR Multi", step=0.1)
smoothing = input(title="ATR Smoothing", defval="WMA", options=["RMA", "SMA", "EMA", "WMA"])

ma_function(source, atrlen) => 
    if smoothing == "RMA"
        rma(source, atrlen)
    else
        if smoothing == "SMA"
            sma(source, atrlen)
        else
            if smoothing == "EMA"
                ema(source, atrlen)
            else
                wma(source, atrlen)
atr_slen = ma_function(tr(true), atrlen)
////ATR Up/Low Bands
upper_band = atr_slen * mult + close
lower_band = close - atr_slen * mult

////BASELINE / SSL1 / SSL2 / EXIT MOVING AVERAGE VALUES
maType = input(title="SSL1 / Baseline Type", type=input.string, defval="HMA", options=["SMA","EMA","DEMA","TEMA","LSMA","WMA","MF","VAMA","TMA","HMA", "JMA", "Kijun v2", "EDSMA","McGinley"])
len = input(title="SSL1 / Baseline Length", defval=60)

SSL2Type = input(title="SSL2 / Continuation Type", type=input.string, defval="JMA", options=["SMA","EMA","DEMA","TEMA","WMA","MF","VAMA","TMA","HMA", "JMA","McGinley"])
len2 = input(title="SSL 2 Length", defval=5)
//
SSL3Type = input(title="EXIT Type", type=input.string, defval="HMA", options=["DEMA","TEMA","LSMA","VAMA","TMA","HMA","JMA", "Kijun v2", "McGinley", "MF"])
len3 = input(title="EXIT Length", defval=15)
src = input(title="Source", type=input.source, defval=close)

//
tema(src, len) =>
    ema1 = ema(src, len)
    ema2 = ema(ema1, len)
    ema3 = ema(ema2, len)
    (3 * ema1) - (3 * ema2) + ema3
kidiv = input(defval=1,maxval=4,  title="Kijun MOD Divider")

jurik_phase = input(title="* Jurik (JMA) Only - Phase", type=input.integer, defval=3)
jurik_power = input(title="* Jurik (JMA) Only - Power", type=input.integer, defval=1)
volatility_lookback = input(10, title="* Volatility Adjusted (VAMA) Only - Volatility lookback length")
//MF
beta = input(0.8,minval=0,maxval=1,step=0.1,  title="Modular Filter, General Filter Only - Beta")
feedback = input(false, title="Modular Filter Only - Feedback")
z = input(0.5,title="Modular Filter Only - Feedback Weighting",step=0.1, minval=0, maxval=1)
//EDSMA
ssfLength = input(title="EDSMA - Super Smoother Filter Length", type=input.integer, minval=1, defval=20)
ssfPoles = input(title="EDSMA - Super Smoother Filter Poles", type=input.integer, defval=2, options=[2, 3])

//----

//EDSMA
get2PoleSSF(src, length) =>
    PI = 2 * asin(1)
    arg = sqrt(2) * PI / length
    a1 = exp(-arg)
    b1 = 2 * a1 * cos(arg)
    c2 = b1
    c3 = -pow(a1, 2)
    c1 = 1 - c2 - c3
    
    ssf = 0.0
    ssf := c1 * src + c2 * nz(ssf[1]) + c3 * nz(ssf[2])

get3PoleSSF(src, length) =>
    PI = 2 * asin(1)

    arg = PI / length
    a1 = exp(-arg)
    b1 = 2 * a1 * cos(1.738 * arg)
    c1 = pow(a1, 2)

    coef2 = b1 + c1
    coef3 = -(c1 + b1 * c1)
    coef4 = pow(c1, 2)
    coef1 = 1 - coef2 - coef3 - coef4

    ssf = 0.0
    ssf := coef1 * src + coef2 * nz(ssf[1]) + coef3 * nz(ssf[2]) + coef4 * nz(ssf[3])

ma(type, src, len) =>
    float result = 0
    if type=="TMA"
        result := sma(sma(src, ceil(len / 2)), floor(len / 2) + 1)
    if type=="MF"
        ts=0.,b=0.,c=0.,os=0.
        //----
        alpha = 2/(len+1)
        a = feedback ? z*src + (1-z)*nz(ts[1],src) : src
        //----
        b := a > alpha*a+(1-alpha)*nz(b[1],a) ? a : alpha*a+(1-alpha)*nz(b[1],a)
        c := a < alpha*a+(1-alpha)*nz(c[1],a) ? a : alpha*a+(1-alpha)*nz(c[1],a)
        os := a == b ? 1 : a == c ? 0 : os[1]
        //----
        upper = beta*b+(1-beta)*c
        lower = beta*c+(1-beta)*b 
        ts := os*upper+(1-os)*lower
        result := ts
    if type=="LSMA"
        result := linreg(src, len, 0)
    if type=="SMA" // Simple
        result := sma(src, len)
    if type=="EMA" // Exponential
        result := ema(src, len)
    if type=="DEMA" // Double Exponential
        e = ema(src, len)
        result := 2 * e - ema(e, len)
    if type=="TEMA" // Triple Exponential
        e = ema(src, len)
        result := 3 * (e - ema(e, len)) + ema(ema(e, len), len)
    if type=="WMA" // Weighted
        result := wma(src, len)
    if type=="VAMA" // Volatility Adjusted
        /// Copyright © 2019 to present, Joris Duyck (JD)
        mid=ema(src,len)
        dev=src-mid
        vol_up=highest(dev,volatility_lookback)
        vol_down=lowest(dev,volatility_lookback)
        result := mid+avg(vol_up,vol_down)
    if type=="HMA" // Hull
        result := wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))
    if type=="JMA" // Jurik
        /// Copyright © 2018 Alex Orekhov (everget)
        /// Copyright © 2017 Jurik Research and Consulting.
        phaseRatio = jurik_phase < -100 ? 0.5 : jurik_phase > 100 ? 2.5 : jurik_phase / 100 + 1.5
        beta = 0.45 * (len - 1) / (0.45 * (len - 1) + 2)
        alpha = pow(beta, jurik_power)
        jma = 0.0
        e0 = 0.0
        e0 := (1 - alpha) * src + alpha * nz(e0[1])
        e1 = 0.0
        e1 := (src - e0) * (1 - beta) + beta * nz(e1[1])
        e2 = 0.0
        e2 := (e0 + phaseRatio * e1 - nz(jma[1])) * pow(1 - alpha, 2) + pow(alpha, 2) * nz(e2[1])
        jma := e2 + nz(jma[1])
        result := jma
    if type=="Kijun v2"
        kijun = avg(lowest(len), highest(len))//, (open + close)/2)
        conversionLine = avg(lowest(len/kidiv), highest(len/kidiv))
        delta = (kijun + conversionLine)/2
        result :=delta
    if type=="McGinley"
        mg = 0.0
        mg := na(mg[1]) ? ema(src, len) : mg[1] + (src - mg[1]) / (len * pow(src/mg[1], 4))
        result :=mg
    if type=="EDSMA"
    
        zeros = src - nz(src[2])
        avgZeros = (zeros + zeros[1]) / 2
        
        // Ehlers Super Smoother Filter 
        ssf = ssfPoles == 2
             ? get2PoleSSF(avgZeros, ssfLength)
             : get3PoleSSF(avgZeros, ssfLength)
        
        // Rescale filter in terms of Standard Deviations
        stdev = stdev(ssf, len)
        scaledFilter = stdev != 0
             ? ssf / stdev
             : 0
        
        alpha = 5 * abs(scaledFilter) / len
        
        edsma = 0.0
        edsma := alpha * src + (1 - alpha) * nz(edsma[1])
        result :=  edsma
    result
    
///SSL 1 and SSL2
emaHigh = ma(maType, high, len)
emaLow = ma(maType, low, len)

maHigh = ma(SSL2Type, high, len2)
maLow = ma(SSL2Type, low, len2)

///EXIT
ExitHigh = ma(SSL3Type, high, len3)
ExitLow = ma(SSL3Type, low, len3)

///Keltner Baseline Channel
BBMC = ma(maType, close, len)
useTrueRange = input(true)
multy = input(0.2, step=0.05, title="Base Channel Multiplier")
Keltma = ma(maType, src, len)
range = useTrueRange ? tr : high - low
rangema = ema(range, len)
upperk =Keltma + rangema * multy
lowerk = Keltma - rangema * multy

//Baseline Violation Candle
open_pos =  open*1
close_pos = close*1
difference = abs(close_pos-open_pos)
atr_violation = difference > atr_slen
InRange = upper_band > BBMC and lower_band < BBMC
candlesize_violation = atr_violation and InRange
plotshape(candlesize_violation, color=color.white, size=size.tiny,style=shape.diamond, location=location.top, transp=0,title="Candle Size > 1xATR")


//SSL1 VALUES
Hlv = int(na)
Hlv := close > emaHigh ? 1 : close < emaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? emaHigh : emaLow

//SSL2 VALUES
Hlv2 = int(na)
Hlv2 := close > maHigh ? 1 : close < maLow ? -1 : Hlv2[1]
sslDown2 = Hlv2 < 0 ? maHigh : maLow

//EXIT VALUES
Hlv3 = int(na)
Hlv3 := close > ExitHigh ? 1 : close < ExitLow ? -1 : Hlv3[1]
sslExit = Hlv3 < 0 ? ExitHigh : ExitLow
base_cross_Long = crossover(close, sslExit)
base_cross_Short = crossover(sslExit, close)
codiff = base_cross_Long ? 1 : base_cross_Short ? -1 : na 

//COLORS
show_color_bar = input(title="Color Bars", type=input.bool, defval=true)
color_bar = close > upperk ? #00c3ff : close < lowerk ? #ff0062 : color.gray
color_ssl1 = close > sslDown ? #00c3ff : close < sslDown ? #ff0062 : na

//PLOTS
plotarrow(codiff, colorup=#00c3ff, colordown=#ff0062,title="Exit Arrows", transp=20, maxheight=20, offset=0)
p1 = plot(show_Baseline ? BBMC : na, color=color_bar, linewidth=4,transp=0, title='MA Baseline')
DownPlot = plot( show_SSL1 ? sslDown : na, title="SSL1", linewidth=3, color=color_ssl1, transp=10)
barcolor(show_color_bar ? color_bar : na)
up_channel = plot(show_Baseline ? upperk : na, color=color_bar, title="Baseline Upper Channel")
low_channel = plot(show_Baseline ? lowerk : na, color=color_bar, title="Basiline Lower Channel")
fill(up_channel, low_channel, color=color_bar, transp=90)

////SSL2 Continiuation from ATR
atr_crit = input(0.9, step=0.1, title="Continuation ATR Criteria")
upper_half = atr_slen * atr_crit + close
lower_half = close - atr_slen * atr_crit
buy_inatr =  lower_half < sslDown2
sell_inatr = upper_half > sslDown2
sell_cont = close < BBMC and close < sslDown2
buy_cont = close > BBMC and close > sslDown2
sell_atr = sell_inatr and sell_cont
buy_atr = buy_inatr and buy_cont
atr_fill = buy_atr ? color.green : sell_atr ? color.purple : color.white
LongPlot = plot(sslDown2, title="SSL2", linewidth=2, color=atr_fill, style=plot.style_circles, transp=0)
u = plot(show_atr ? upper_band : na, "+ATR", color=color.white, transp=80)
l = plot(show_atr ? lower_band : na, "-ATR", color=color.white, transp=80)

//ALERTS
alertcondition(crossover(close, sslDown), title='SSL Cross Alert', message='SSL1 has crossed.')
alertcondition(crossover(close, sslDown2), title='SSL2 Cross Alert', message='SSL2 has crossed.')
alertcondition(sell_atr, title='Sell Continuation', message='Sell Continuation.')
alertcondition(buy_atr, title='Buy Continuation', message='Buy Continuation.')
alertcondition(crossover(close, sslExit), title='Exit Sell', message='Exit Sell Alert.')
alertcondition(crossover(sslExit, close), title='Exit Buy', message='Exit Buy Alert.')
alertcondition(crossover(close, upperk ), title='Baseline Buy Entry', message='Base Buy Alert.')
alertcondition(crossover(lowerk, close ), title='Baseline Sell Entry', message='Base Sell Alert.')

我想在蜡烛上更改蜡烛上的颜色。

Don't works like i want.

The modification make a mistake in the MA baseline.

Here is the full code.

Thanks

//@version=4
//By Mihkel00
// This script is designed for the NNFX Method, so it is recommended for Daily charts only. 
// Tried to implement a few VP NNFX Rules
// This script has a SSL / Baseline (you can choose between the SSL or MA), a secondary SSL for continiuation trades and a third SSL for exit trades.
// Alerts added for Baseline entries, SSL2 continuations, Exits.
// Baseline has a Keltner Channel setting for "in zone" Gray Candles
// Added "Candle Size > 1 ATR" Diamonds from my old script with the criteria of being within Baseline ATR range.
// Credits
// Strategy causecelebre https://www.tradingview.com/u/causecelebre/
// SSL Channel ErwinBeckers https://www.tradingview.com/u/ErwinBeckers/
// Moving Averages jiehonglim https://www.tradingview.com/u/jiehonglim/
// Moving Averages  everget https://www.tradingview.com/u/everget/
// "Many Moving Averages" script  Fractured https://www.tradingview.com/u/Fractured/
study("SSL Hybrid", overlay=true)
show_Baseline = input(title="Show Baseline", type=input.bool, defval=true)
show_SSL1 = input(title="Show SSL1", type=input.bool, defval=false)
show_atr = input(title="Show ATR bands", type=input.bool, defval=true)
//ATR
atrlen = input(14, "ATR Period")
mult = input(1, "ATR Multi", step=0.1)
smoothing = input(title="ATR Smoothing", defval="WMA", options=["RMA", "SMA", "EMA", "WMA"])

ma_function(source, atrlen) => 
    if smoothing == "RMA"
        rma(source, atrlen)
    else
        if smoothing == "SMA"
            sma(source, atrlen)
        else
            if smoothing == "EMA"
                ema(source, atrlen)
            else
                wma(source, atrlen)
atr_slen = ma_function(tr(true), atrlen)
////ATR Up/Low Bands
upper_band = atr_slen * mult + close
lower_band = close - atr_slen * mult

////BASELINE / SSL1 / SSL2 / EXIT MOVING AVERAGE VALUES
maType = input(title="SSL1 / Baseline Type", type=input.string, defval="HMA", options=["SMA","EMA","DEMA","TEMA","LSMA","WMA","MF","VAMA","TMA","HMA", "JMA", "Kijun v2", "EDSMA","McGinley"])
len = input(title="SSL1 / Baseline Length", defval=60)

SSL2Type = input(title="SSL2 / Continuation Type", type=input.string, defval="JMA", options=["SMA","EMA","DEMA","TEMA","WMA","MF","VAMA","TMA","HMA", "JMA","McGinley"])
len2 = input(title="SSL 2 Length", defval=5)
//
SSL3Type = input(title="EXIT Type", type=input.string, defval="HMA", options=["DEMA","TEMA","LSMA","VAMA","TMA","HMA","JMA", "Kijun v2", "McGinley", "MF"])
len3 = input(title="EXIT Length", defval=15)
src = input(title="Source", type=input.source, defval=close)

//
tema(src, len) =>
    ema1 = ema(src, len)
    ema2 = ema(ema1, len)
    ema3 = ema(ema2, len)
    (3 * ema1) - (3 * ema2) + ema3
kidiv = input(defval=1,maxval=4,  title="Kijun MOD Divider")

jurik_phase = input(title="* Jurik (JMA) Only - Phase", type=input.integer, defval=3)
jurik_power = input(title="* Jurik (JMA) Only - Power", type=input.integer, defval=1)
volatility_lookback = input(10, title="* Volatility Adjusted (VAMA) Only - Volatility lookback length")
//MF
beta = input(0.8,minval=0,maxval=1,step=0.1,  title="Modular Filter, General Filter Only - Beta")
feedback = input(false, title="Modular Filter Only - Feedback")
z = input(0.5,title="Modular Filter Only - Feedback Weighting",step=0.1, minval=0, maxval=1)
//EDSMA
ssfLength = input(title="EDSMA - Super Smoother Filter Length", type=input.integer, minval=1, defval=20)
ssfPoles = input(title="EDSMA - Super Smoother Filter Poles", type=input.integer, defval=2, options=[2, 3])

//----

//EDSMA
get2PoleSSF(src, length) =>
    PI = 2 * asin(1)
    arg = sqrt(2) * PI / length
    a1 = exp(-arg)
    b1 = 2 * a1 * cos(arg)
    c2 = b1
    c3 = -pow(a1, 2)
    c1 = 1 - c2 - c3
    
    ssf = 0.0
    ssf := c1 * src + c2 * nz(ssf[1]) + c3 * nz(ssf[2])

get3PoleSSF(src, length) =>
    PI = 2 * asin(1)

    arg = PI / length
    a1 = exp(-arg)
    b1 = 2 * a1 * cos(1.738 * arg)
    c1 = pow(a1, 2)

    coef2 = b1 + c1
    coef3 = -(c1 + b1 * c1)
    coef4 = pow(c1, 2)
    coef1 = 1 - coef2 - coef3 - coef4

    ssf = 0.0
    ssf := coef1 * src + coef2 * nz(ssf[1]) + coef3 * nz(ssf[2]) + coef4 * nz(ssf[3])

ma(type, src, len) =>
    float result = 0
    if type=="TMA"
        result := sma(sma(src, ceil(len / 2)), floor(len / 2) + 1)
    if type=="MF"
        ts=0.,b=0.,c=0.,os=0.
        //----
        alpha = 2/(len+1)
        a = feedback ? z*src + (1-z)*nz(ts[1],src) : src
        //----
        b := a > alpha*a+(1-alpha)*nz(b[1],a) ? a : alpha*a+(1-alpha)*nz(b[1],a)
        c := a < alpha*a+(1-alpha)*nz(c[1],a) ? a : alpha*a+(1-alpha)*nz(c[1],a)
        os := a == b ? 1 : a == c ? 0 : os[1]
        //----
        upper = beta*b+(1-beta)*c
        lower = beta*c+(1-beta)*b 
        ts := os*upper+(1-os)*lower
        result := ts
    if type=="LSMA"
        result := linreg(src, len, 0)
    if type=="SMA" // Simple
        result := sma(src, len)
    if type=="EMA" // Exponential
        result := ema(src, len)
    if type=="DEMA" // Double Exponential
        e = ema(src, len)
        result := 2 * e - ema(e, len)
    if type=="TEMA" // Triple Exponential
        e = ema(src, len)
        result := 3 * (e - ema(e, len)) + ema(ema(e, len), len)
    if type=="WMA" // Weighted
        result := wma(src, len)
    if type=="VAMA" // Volatility Adjusted
        /// Copyright © 2019 to present, Joris Duyck (JD)
        mid=ema(src,len)
        dev=src-mid
        vol_up=highest(dev,volatility_lookback)
        vol_down=lowest(dev,volatility_lookback)
        result := mid+avg(vol_up,vol_down)
    if type=="HMA" // Hull
        result := wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))
    if type=="JMA" // Jurik
        /// Copyright © 2018 Alex Orekhov (everget)
        /// Copyright © 2017 Jurik Research and Consulting.
        phaseRatio = jurik_phase < -100 ? 0.5 : jurik_phase > 100 ? 2.5 : jurik_phase / 100 + 1.5
        beta = 0.45 * (len - 1) / (0.45 * (len - 1) + 2)
        alpha = pow(beta, jurik_power)
        jma = 0.0
        e0 = 0.0
        e0 := (1 - alpha) * src + alpha * nz(e0[1])
        e1 = 0.0
        e1 := (src - e0) * (1 - beta) + beta * nz(e1[1])
        e2 = 0.0
        e2 := (e0 + phaseRatio * e1 - nz(jma[1])) * pow(1 - alpha, 2) + pow(alpha, 2) * nz(e2[1])
        jma := e2 + nz(jma[1])
        result := jma
    if type=="Kijun v2"
        kijun = avg(lowest(len), highest(len))//, (open + close)/2)
        conversionLine = avg(lowest(len/kidiv), highest(len/kidiv))
        delta = (kijun + conversionLine)/2
        result :=delta
    if type=="McGinley"
        mg = 0.0
        mg := na(mg[1]) ? ema(src, len) : mg[1] + (src - mg[1]) / (len * pow(src/mg[1], 4))
        result :=mg
    if type=="EDSMA"
    
        zeros = src - nz(src[2])
        avgZeros = (zeros + zeros[1]) / 2
        
        // Ehlers Super Smoother Filter 
        ssf = ssfPoles == 2
             ? get2PoleSSF(avgZeros, ssfLength)
             : get3PoleSSF(avgZeros, ssfLength)
        
        // Rescale filter in terms of Standard Deviations
        stdev = stdev(ssf, len)
        scaledFilter = stdev != 0
             ? ssf / stdev
             : 0
        
        alpha = 5 * abs(scaledFilter) / len
        
        edsma = 0.0
        edsma := alpha * src + (1 - alpha) * nz(edsma[1])
        result :=  edsma
    result
    
///SSL 1 and SSL2
emaHigh = ma(maType, high, len)
emaLow = ma(maType, low, len)

maHigh = ma(SSL2Type, high, len2)
maLow = ma(SSL2Type, low, len2)

///EXIT
ExitHigh = ma(SSL3Type, high, len3)
ExitLow = ma(SSL3Type, low, len3)

///Keltner Baseline Channel
BBMC = ma(maType, close, len)
useTrueRange = input(true)
multy = input(0.2, step=0.05, title="Base Channel Multiplier")
Keltma = ma(maType, src, len)
range = useTrueRange ? tr : high - low
rangema = ema(range, len)
upperk =Keltma + rangema * multy
lowerk = Keltma - rangema * multy

//Baseline Violation Candle
open_pos =  open*1
close_pos = close*1
difference = abs(close_pos-open_pos)
atr_violation = difference > atr_slen
InRange = upper_band > BBMC and lower_band < BBMC
candlesize_violation = atr_violation and InRange
plotshape(candlesize_violation, color=color.white, size=size.tiny,style=shape.diamond, location=location.top, transp=0,title="Candle Size > 1xATR")


//SSL1 VALUES
Hlv = int(na)
Hlv := close > emaHigh ? 1 : close < emaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? emaHigh : emaLow

//SSL2 VALUES
Hlv2 = int(na)
Hlv2 := close > maHigh ? 1 : close < maLow ? -1 : Hlv2[1]
sslDown2 = Hlv2 < 0 ? maHigh : maLow

//EXIT VALUES
Hlv3 = int(na)
Hlv3 := close > ExitHigh ? 1 : close < ExitLow ? -1 : Hlv3[1]
sslExit = Hlv3 < 0 ? ExitHigh : ExitLow
base_cross_Long = crossover(close, sslExit)
base_cross_Short = crossover(sslExit, close)
codiff = base_cross_Long ? 1 : base_cross_Short ? -1 : na 

//COLORS
show_color_bar = input(title="Color Bars", type=input.bool, defval=true)
color_bar = close > upperk ? #00c3ff : close < lowerk ? #ff0062 : color.gray
color_ssl1 = close > sslDown ? #00c3ff : close < sslDown ? #ff0062 : na

//PLOTS
plotarrow(codiff, colorup=#00c3ff, colordown=#ff0062,title="Exit Arrows", transp=20, maxheight=20, offset=0)
p1 = plot(show_Baseline ? BBMC : na, color=color_bar, linewidth=4,transp=0, title='MA Baseline')
DownPlot = plot( show_SSL1 ? sslDown : na, title="SSL1", linewidth=3, color=color_ssl1, transp=10)
barcolor(show_color_bar ? color_bar : na)
up_channel = plot(show_Baseline ? upperk : na, color=color_bar, title="Baseline Upper Channel")
low_channel = plot(show_Baseline ? lowerk : na, color=color_bar, title="Basiline Lower Channel")
fill(up_channel, low_channel, color=color_bar, transp=90)

////SSL2 Continiuation from ATR
atr_crit = input(0.9, step=0.1, title="Continuation ATR Criteria")
upper_half = atr_slen * atr_crit + close
lower_half = close - atr_slen * atr_crit
buy_inatr =  lower_half < sslDown2
sell_inatr = upper_half > sslDown2
sell_cont = close < BBMC and close < sslDown2
buy_cont = close > BBMC and close > sslDown2
sell_atr = sell_inatr and sell_cont
buy_atr = buy_inatr and buy_cont
atr_fill = buy_atr ? color.green : sell_atr ? color.purple : color.white
LongPlot = plot(sslDown2, title="SSL2", linewidth=2, color=atr_fill, style=plot.style_circles, transp=0)
u = plot(show_atr ? upper_band : na, "+ATR", color=color.white, transp=80)
l = plot(show_atr ? lower_band : na, "-ATR", color=color.white, transp=80)

//ALERTS
alertcondition(crossover(close, sslDown), title='SSL Cross Alert', message='SSL1 has crossed.')
alertcondition(crossover(close, sslDown2), title='SSL2 Cross Alert', message='SSL2 has crossed.')
alertcondition(sell_atr, title='Sell Continuation', message='Sell Continuation.')
alertcondition(buy_atr, title='Buy Continuation', message='Buy Continuation.')
alertcondition(crossover(close, sslExit), title='Exit Sell', message='Exit Sell Alert.')
alertcondition(crossover(sslExit, close), title='Exit Buy', message='Exit Buy Alert.')
alertcondition(crossover(close, upperk ), title='Baseline Buy Entry', message='Base Buy Alert.')
alertcondition(crossover(lowerk, close ), title='Baseline Sell Entry', message='Base Sell Alert.')

I want just change the color on the candle when it's grey.

颜色栏,但仅在一个情况下

一身仙ぐ女味 2025-02-07 06:14:49

只需将数字输入为字符串即

String? chossenNumber =  stdin. readLineSync();

它的解决方案非常简单,

if(int.parse(chossenNumber) <100)
{
print("Your Statement");
}

The solution of it very simple just take input of number as String i.e

String? chossenNumber =  stdin. readLineSync();

and when you want to use this variable parse it to the 'int' i.e

if(int.parse(chossenNumber) <100)
{
print("Your Statement");
}

如何从DART中的用户获取整数输入

一身仙ぐ女味 2025-02-06 00:29:45

您可以使用 id_month 的复合键使用相当标准的“组”。

该示例使用 要迭代阵列, tolocaledateString() 从ISO日期字符串中检索月份名称,a 模板字面创建化合物键。

得分应在添加之前转换为数字,以避免意外串联在这里使用 Unary Plus(+)操作员。

最后,我们只采取 object。结果为结果 结果。

const array = [{ id: "121", score: "5", createdOn: "2022-05-17T19:52:23.6846702+00:00" }, { id: "121", score: "8", createdOn: "2022-05-19T13:00:00.6846702+00:00" }, { id: "122", score: "7", createdOn: "2022-04-11T08:00:00.6846702+00:00" }, { id: "121", score: "1", createdOn: "2022-03-12T12:00:00.6846702+00:00" },];

const result = Object.values(
  array.reduce((a, { id, createdOn, score, ...rest }) => {
    const month = new Date(createdOn).toLocaleDateString('en', { month: 'long' });

    a[`${id}_${month}`] ??= { id, month, score: 0, ...rest };
    a[`${id}_${month}`].score += +score;
    
    return a;
  }, {})
)

console.log(result)

完全相同的逻辑可以在标准 如果您愿意的话, redable()调用。

const array = [{ id: "121", score: "5", createdOn: "2022-05-17T19:52:23.6846702+00:00" }, { id: "121", score: "8", createdOn: "2022-05-19T13:00:00.6846702+00:00" }, { id: "122", score: "7", createdOn: "2022-04-11T08:00:00.6846702+00:00" }, { id: "121", score: "1", createdOn: "2022-03-12T12:00:00.6846702+00:00" },];

const grouped = {}

for (const { id, createdOn, score, ...rest } of array) {
  const month = new Date(createdOn).toLocaleDateString('en', { month: 'long' });

  grouped[`${id}_${month}`] ??= { id, month, score: 0, ...rest }
  grouped[`${id}_${month}`].score += +score;
}

const result = Object.values(grouped);

console.log(result)

You can use a fairly standard 'group by' using a compound key of id_month.

The example uses reduce() to iterate the array, toLocaleDateString() to retrieve the month name from the ISO date string and a template literal to create the compound key.

The score should be converted to a number before adding to avoid accidental concatenation, here using the unary plus (+) operator.

Finally we take just the Object.values of the grouped object as the result.

const array = [{ id: "121", score: "5", createdOn: "2022-05-17T19:52:23.6846702+00:00" }, { id: "121", score: "8", createdOn: "2022-05-19T13:00:00.6846702+00:00" }, { id: "122", score: "7", createdOn: "2022-04-11T08:00:00.6846702+00:00" }, { id: "121", score: "1", createdOn: "2022-03-12T12:00:00.6846702+00:00" },];

const result = Object.values(
  array.reduce((a, { id, createdOn, score, ...rest }) => {
    const month = new Date(createdOn).toLocaleDateString('en', { month: 'long' });

    a[`${id}_${month}`] ??= { id, month, score: 0, ...rest };
    a[`${id}_${month}`].score += +score;
    
    return a;
  }, {})
)

console.log(result)

The exact same logic can be used in a standard for...of loop instead of within a reduce() call if you prefer.

const array = [{ id: "121", score: "5", createdOn: "2022-05-17T19:52:23.6846702+00:00" }, { id: "121", score: "8", createdOn: "2022-05-19T13:00:00.6846702+00:00" }, { id: "122", score: "7", createdOn: "2022-04-11T08:00:00.6846702+00:00" }, { id: "121", score: "1", createdOn: "2022-03-12T12:00:00.6846702+00:00" },];

const grouped = {}

for (const { id, createdOn, score, ...rest } of array) {
  const month = new Date(createdOn).toLocaleDateString('en', { month: 'long' });

  grouped[`${id}_${month}`] ??= { id, month, score: 0, ...rest }
  grouped[`${id}_${month}`].score += +score;
}

const result = Object.values(grouped);

console.log(result)

如何根据日期和ID总和数组总和一个值

一身仙ぐ女味 2025-02-05 18:25:09

您需要用OBX包裹底部导航栏

You need to wrap your bottom navigation bar with Obx

我无法将GETX状态管理值分配给整数

一身仙ぐ女味 2025-02-05 10:50:37

成为程序员的特权;由于经历了漫长的过程,即通过将小部件放置在其他小部件中,因此我只是复制并将其粘贴到封闭构建器中。

简单的解决方案是仅采用 card 并将其放置在 return 封闭式构建器的语句中,而没有其 eT> getruestector 和Inkwell(当然,这两个都有Ontaps,这会使事情变得非常奇怪)。

Perks of being a programmer; due to going through a long process of getting widgets to work by putting them within other widgets, I just copied and pasted them into the closedBuilder.

The simple solution was to just take the Card and place it within the return statement of the closedBuilder, without its GestureDetector and InkWell (of course, both of them have onTaps as well, would make things very wonky).

opencontainer动画在单层次Crollview中不起作用

一身仙ぐ女味 2025-02-04 21:02:56

对于像我这样会遇到这种问题的人
我仅通过将一些JavaScript放入触点7正文中就成功解决了这个问题

<script type="text/javascript">
jQuery(document).ready(function($) {
  $('#putphp').val('<?php echo $some_variable; ?>');
});
</script>

For people like me who gonna get this kind of issue,
i succeded fixing this just by putting some javascript into the contact form 7 body

<script type="text/javascript">
jQuery(document).ready(function($) {
  $('#putphp').val('<?php echo $some_variable; ?>');
});
</script>

如何将php插入触点7场主体

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文