Development of initial ballance automated strategy

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #30176 quote
    Elsborgtrading
    Participant
    Veteran

    I have moved the development topic here- Feel free to join the development and cast your ideas here. To begin with I have made a short only version. It’s still not profitable if run on tick by tick backtest.

    Original indicator topic is here.

    Nicolas thanked this post
    #30180 quote
    Abz
    Participant
    Veteran

    hello

    what are i doing wrong here? my goal is as following

    1. upper is the highest price between 080000 and 090000
    2. enter short when price goes under “upper”
    3. next bar also close under upper and i also want to be sure that this bar high is also under “upper”
    4. target and profitt is the amount of points between upper and lower
    
    DEFPARAM CumulateOrders = false // Cumulating positions
    DEFPARAM PRELOADBARS = 1000
    DEFPARAM FLATAFTER = 220000
    
    IF Time = 080000 THEN
    TradeCounter = 0
    ENDIF
    
    // Trading Hours
    IF (Time >= 090000 AND Time <= t1) and dayofweek<=5 then// or (Time >= 220000 AND Time <= 220100) and dayofweek=1  THEN //
    Tradetime=1
    else
    Tradetime=0
    endif
    t1=220000
    
    //Settings
    once upper=0
    once lower=0
    
    // calculate upper and lower
    endtime = 090000
    If Time = endtime then
    upper=highest[12](high)
    lower=lowest[12](low)
    dif=round(abs((lower-upper)*pipsize*pointvalue))
    endif
    
    //looking for short position
    entershort1 = close[1] > upper
    entershort2 = close crosses under upper
    entershort3 = close < upper
    
    if not onmarket and entershort1 and entershort2 and entershort3 then
    fadeshort=1
    elsif onmarket then
    fadeshort=0
    endif
    
    if not onmarket and tradecounter < 1 and tradetime and fadeshort then
    sellshort 5 contracts at market
    TradeCounter = TradeCounter + 1
    endif
    
    set stop loss dif
    set target profit dif
    
    #30182 quote
    Elsborgtrading
    Participant
    Veteran

    There is something wrong with this code. It’s not behaving as expected. I need to take a look.

    Cheers Kasper

    Abz thanked this post
    #30184 quote
    Abz
    Participant
    Veteran

    if you coud help me to add long as well it woud be great.

    #31035 quote
    Abz
    Participant
    Veteran

    hello Casper

    have you been able to look at this code?

    #31067 quote
    Elsborgtrading
    Participant
    Veteran

    yes I have, and I was not able to get any positive results on a automated strategy. I Will devote my time to other projects as this has taken huge amount of my spare time only to be caught in the optimization process and zero bar trading.

    #31952 quote
    dajvop
    Participant
    Master

    I tried a buy signal with low < lower which seems to work, limited to 0900-0915 am.

    Then, either sell at high > upper or limit or trailing stop, depending on your preferences.

    Seems solid with walk forward also.

    Best regards, David

    #31954 quote
    Nicolas
    Keymaster
    Master

    @dajvop You should share your modified code to encourage our friend Kasper! 🙂 I feel like he needs our support! Cheers Kasper 🙂

    #31958 quote
    dajvop
    Participant
    Master

    Sure, just bear in mind that it is pretty simple 🙂

    Initial-Balance-System.itf
    #32186 quote
    Elsborgtrading
    Participant
    Veteran

    Hejsan Dajvop.

    Thanks for sharing you development. Initially it looks good- it has a profit. However the stop loss at 1.5% of the average tradeprice would yield somewhat in the neighbourhood of 180 points. If we take a look at the average gain it’s an RR of 0.1. that’s not good. I tried to optimize your code with a lower plain stoploss, but I could not come up with something more sustainable number. My own testing was trying to trade max 2 trades a day 9:00-17:00 and inside the initial balance if below 40 pips and above 40 pips as a breakout strategy. however I never liked the results, so I stopped the testing.

    Cheers Kasper

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Development of initial ballance automated strategy


General Trading: Market Analysis & Manual Trading

New Reply
Author
Summary

This topic contains 9 replies,
has 4 voices, and was last updated by Elsborgtrading
8 years, 10 months ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 03/28/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...