Untitled

 avatar
unknown
plain_text
a month ago
404 B
21
Indexable
qty(int n) =>
    lots = 0.0
    pos = lots
    neg = 0.0
    target = k // rr
    spread = 0.1
    pips = k + 1 + spread
    for i=0 to n
        if i == 0
            lots := startQty // initial qty
        else
            _pos = pos
            lots := math.ceil(math.round(((pos * pips / target) - neg) / step, 9)) * step
            pos := neg + lots
            neg := _pos
    lots
Leave a Comment