0

只想在收盘价上方和下方打印两条水平线。

水平线值 = 最接近收盘价的斐波那契数。

下面基本上是一个生成斐波那契数的函数。

有很多错误。请帮助

int fib_counter_under_close_c = 0
int fib_counter_under_close_b = 1
int fib_counter_under_close_a = 0, 

int fib_counter_above_close_a = 0, fib_counter_above_close_b = 1 , fib_counter_above_close_c = 0

min_acceptable_close_value_line_value_end_fib  = 3

if close_timeframe > min_acceptable_close_value_line_value_end_fib //and show_line_value_end_fib   
    for line_value_end_fib = min_acceptable_close_value_line_value_end_fib  to close  
        fib_counter_under_close_c   =   fib_counter_under_close_a   +   fib_counter_under_close_b
        fib_counter_under_close_a   =   fib_counter_under_close_b
        fib_counter_under_close_b   =   fib_counter_under_close_c
        
        fib_counter_above_close_c   =   fib_counter_above_close_a   +   fib_counter_above_close_b
        fib_counter_above_close_a   =   fib_counter_above_close_b
        fib_counter_above_close_b   =   fib_counter_above_close_c

    
        if( (fib_counter_under_close_c < close_timeframe) and ( fib_counter_above_close_b > close_timeframe) )    
            break
    


plot_line_value_end_fib_return       =   fib_counter_under_close_c
plot_line_value_end_fib_1_return     =   fib_counter_above_close_b

4

0 回答 0