Initial balance condition

Forums ProRealTime English forum ProOrder support Initial balance condition

Viewing 6 posts - 1 through 6 (of 6 total)
  • #177547

    Hi. I’ve edited some code I found on here to create a simple initial balance indicator “Balance 15m NASDAQ”. See below.

    //15 min Time frame
    //Initial Ballance calculation
    //First Hour in the morning form 8:00-9:00 GMT+1 on DAX

    starttime = 143000
    endtime = 153000

    If Time = endtime then
    upper=highest[4](high)
    lower=lowest[4](low)
    dif=round(abs(lower-upper))

    endif

    RETURN dif

     

    I want to use the following code as another condition before entering a trade

    //Initial balance
    myBalance15mNASDAQ = CALL “Balance 15m NASDAQ”
    c9 = (myBalance15mNASDAQ <50)

    But when I back test the results are unaffected? Even when I change to <5 for example?

    What am I doing wrong please?

     

    Tried it like this too, same result?

    //Initial balance
    myBalance15mNASDAQ = CALL “Balance 15m NASDAQ”

    //Conditions to enter long positions
    indicator1 = ExponentialAverage[7.8](close)
    indicator2 = ExponentialAverage[12.6](close)
    c1 = (indicator1 CROSSES OVER indicator2)

    IF c1 AND myBalance15mNASDAQ <50 AND not daysForbiddenEntry THEN
    BUY 0.5 CONTRACT AT MARKET
    ENDIF

     

     

    #177561

    My code works fine.

    Indicator:

    Strategy:

    I think your code actually opened a trade, but it was left open as no SL or TP were planned (test it again and check among opened orders).
    Adding SL and TP should work it out.

    1 user thanked author for this post.
    #177580

    Thank you.

    Did you have to change anything? I’ll have a go at inserting your code tomorrow. This is only a section of the code, I have a SL set and exit parameters too further down.

     

    Thanks again I really appreciate this, I’m very new to this with lots to learn .

    #177586

    I’ve got it working as part of my algo now. I’m not sure why it wasn’t working originally? Must have been syntax?

    Thanks again.

    #179852

    Hi there,

    I’ve tried a very close piece of code, but can’t manage to open a position. It might be easy however. Any adea ? thanks for your help.

     

     

    #179858

    Everything looks ok to me. Maybe try removing the “>=090500 and Time <=153000″ and maybe use “close > IBup” instead of “close CROSSES OVER IBup”

    I’m very new to this, so this is my best guess.

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login