Grid orders with one combined stop loss and limit, can it be done?

Forums ProRealTime English forum ProOrder support Grid orders with one combined stop loss and limit, can it be done?

Viewing 15 posts - 46 through 60 (of 308 total)
  • #6775

    Hi guys!

    This code looks really interesting and I’m following your work and progress since I think proper money management is a key to profitable trading.

    Just a thought on the 1% stoploss. As it is coded now   newSL = positionprice – (positionprice*0.99) doesn’t it just calculate the difference between the positionprice and the new sl? Shouldn’t it just be newSL = positionprice*0.99?

     

     

    #6779

    This code states:

    make the New Stop Loss = POSITIONPRICE (being the average of the Positions Price(s) – 1% of the Average Position Price(s))

    Lets say the Position Prices are:

    95 + 100 +105 = 300

    300/3 = 100

    newSL = 100 – (100*0.99)

    newSL = 100 – 99

    newSL = 1 (which is 1% of 100)

    If understand it correctly.

    #6799

    @Brage @dwgfx

    Thanks for your help.

    Yes It were that I thought at the first glance, but since we want to exit at 1% loss of the account balance, it’s not it 🙂

    So now tests are good, I coded the sell side version and made a small fixed for forex pairs. Here is the full code (also attached in itf file to this post):

     

    Please don’t leech it only. Instead, please add comments or any ideas that would improve a strategy or create a new one with this code. There are many brainful traders here and i’m pretty sure that we can make something cool all together with this nice money management idea 🙂

    #6817

    Amazing Nicolas and thanks a lot! I will start testing it tonight and I’ll come back with an update tomorrow night…

    #6839

    YES! 🙂

    #6842

    I’m afraid I have already come across some trouble, when I try to run the code in real time market I get this error message and the system is stopped;

    “This trading system was stopped due to a division by zero during the evaluation of the last candlestick. Please add protections to your code to prevent divisions by zero.”

    This is the code I was using, tried both long and short and with or without the graph line;

    Any idea what might be the problem?

    #6856

    Ahahah

    “division by zero” is something that ProBacktest don’t know apparently 🙂

    Well, if you have set correctly the line 7 to 10 (no zero values), the problem is in line 26 (this is the only code line with a division).

    A quick fix would be, move the line 26 into the “//stoploss trigger” function, like this:

    That would make the trick.

     

    #6867

    Great work! This is fun! 🙂
    Question: Is it possibile to add a breakeven function, and a stop loss that moves up when the orders are in profit?

    I thought the code:

    would do that, but it seems like the stop loss don’t take the profit (from the orders) into calculation? But only start account balace?

    So maybe a breakeven function, and a stop loss that moves up when the orders are in profit based on equity curve?

    I have tried this but can’t make it right.

    Or will this behave differently in real market?

    All the best!

    #6870

    Yes, everything’s possible.

    Actually, the code don’t calculate the floating profit. The code do actually exactly what cfta wanted and there’s no any ‘takeprofit’ system in it. I already have some ideas for that based on the live equity curve as you mentioned it.

    Firstly I would like to find a mechanical way to enter the market for this system, that would be fun 🙂 Any idea?

    #6872

    Nice Nicolas!

    Yes, I have thought and tried a few things 🙂
    My conclustion was that maybe it isn’t nessesarily because of the 1% account stop loss.

    Otherwise my best suggestions is:

    a) Entry based on pricemove:

    b) “Good old turtle fashion” (on 5min TF):

    c) I have also tried MA, but don’t like it:

    But as said, maybe this is not nessisarily, or maybe a “mini-turtle” is enough :

    I also think its important that I don’t “cut” this thread from cfta, since he started it 🙂

    #6873
    #6880

    You are right. I’ll code floating profit of the whole orders basket and then we’ll can move stoploss accordingly to x% profit.

    About entries, breakout of recent highs or lows is clever. However, I think that we should introduce another trigger like recent volatility.

    #6891

    Hi Nicolas and cfta!

     

    Nice work so far. Really interesting.

    Can this grid order code be combined with any of the 15-min Breakout-systems in the library for a daytrading system? With gridsteps and riskpercent adjusted to the market traded? And perhaps flat after market close?

    #6893

    Yes of course. It only needs some copy/paste experience 🙂

    I need to finish some other things right now, maybe someone can have a look in the mean time.

    #6951

    Good morning fellows,

    I had a very long day at my regular old school job yesterday so I didn’t have time for posting but I did some testing remotely. I’m thrilled to see all the suggestions for further developement, a stop loss triggered by trend change, by MA cross, stochastics, ADX or whatever is the most effective is of course a great way to maximize profits.

    For the real market testing everything looks well, entries where taken as intended and the SL worked perfectly. Great job Nicolas!

    I’ll stay in the mix for discussing further improvements…

Viewing 15 posts - 46 through 60 (of 308 total)

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