Buy at every drop

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #160400 quote
    Boagz07
    Participant
    New

    So I’m pretty new to this whole thing, what I wanted to do was open a new position every time a price goes down. I assume that I have to compare the latest price to the previous one but I could be wrong. Also in doing it this way would there be any restrictions on what timeframes it would work or would it allow me to do it from 1 second all the way through to the day? I have had a play around but I’m not getting anywhere, any pointers would be appreciated.

    #160401 quote
    Nicolas
    Keymaster
    Master

    The below code place a pending limit order x points (step) below the last opened price. It will accumulate orders for ever, there is no coded exit, you’ll have to add your own.

    defparam cumulateorders=true
    
    step = 20
    
    if rsi[14] crosses over 50 then 
    buy 1 contract at market 
    buy 1 contract at tradeprice-step*pointsize limit
    endif
    
    if longonmarket then 
    buy 1 contract at tradeprice-step*pointsize limit 
    endif
    #160407 quote
    robertogozzi
    Moderator
    Master

    You can use any TF, at your choice, since, say, a 5% drop is such on a Daily TF and 1-second TF.

    There you go:

    Defparam CumulateOrders = True
    Once MyPrice = close //First price to start
    Once PerCent = 5     //5% drop
    If Not OnMarket and OnMarket[1] then
       MyPrice = close
    Endif
    If close <= (MyPrice * (1 - (PerCent / 100))) then
       MyPrice = close
       Buy 1 contract at Market
       Set Stop   pLoss   100   //100-pip SL
       Set Target pProfit 200  //200-pip TP
    Endif
    #160408 quote
    robertogozzi
    Moderator
    Master

    AhAhAh…. two is always better than one!

    #160420 quote
    Boagz07
    Participant
    New

    Thanks guys I’ll give them a spin and let you know how I get on

    #160615 quote
    Boagz07
    Participant
    New

    It seems to work close to how I would like in back test but there are some results that don’t make sense to me.

    However as soon as I try it out on a demo account I keep getting an error message about stop limits despite removing all of the stops. I don’t know if I am over or underthinking the code or I just don’t know wtf I am doing.

    I basically want it to ignore market conditions

    and then execute the following flow

    IF //Price drops 1 Point ---(either of these should work)---&nbsp; IF Current price < previous price// THEN 
    buy x Contract at Market
    SET TARGET pPROFIT x
    ENDIF

     

    I don’t want it to close any positions unless it hits that profit target or I manually go in and close the.

    Also is there a way to remove the number of trades that can be made per day or increase it over 1000?

    #160632 quote
    Vonasi
    Moderator
    Master

    Brokers have minimum distances and it is not possible to place orders under these minimum distances. Nothing can be done to change this.

    Brokers also have a maximum number of trades that can be placed in a day – this is to save you from yourself and to save them from having to cope with high frequency trading. Nothing can be done to change this.

    Unless you have a bank roll the size of a hedge funds then I would avoid your trading idea as one day you will buy your first entry at the top just before a market crash and then continue buying all the way to the bottom only stopping when all your money runs out.

    Note: Please follow the forum rules and:

    • Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

     

    Your post has been edited.

    #160754 quote
    Boagz07
    Participant
    New

    I have already taken into account the possibility of that happening and will be limiting the amount of open contracts at any one time

    As for the other issues I have duplicated the system manually it’s just an absolute pain doing it that way hence the automation

    #160756 quote
    Vonasi
    Moderator
    Master

    I have already taken into account the possibility of that happening

    The possibility of it happening is 100% – and the only way to take that into account is to have a bank account that you don’t mind emptying… or to be trading using other peoples money.

    They call it ‘catching a falling knife’ for a very good reason.

    Have you even considered how much margin is required to trade in such a way? You will get a margin call (or lots of margin calls!) long before your account is empty and your trades will be closed out one by one at a loss by the broker.

    #160763 quote
    Boagz07
    Participant
    New

    Got to risk it for the biscuit mate and I get where your coming from however the most I would be loosing using my idea would be 70k which I am prepared to dust a couple of times and it would only his that point if the entire market went to zero, which is an absolutely catastrophic event and I’m sure the least of anyone’s problems will be the money at that point. I’m certainly not going into this blind and I will be running a lot of tests before I actually put my money on the line.

    #160771 quote
    Vonasi
    Moderator
    Master

    If you are insistent on giving money away then this discussion that I started a while back might be of interest to you:

    Catching a falling knife ideas

    #160885 quote
    Boagz07
    Participant
    New

    perfect that’s exactly the help what I needed to read cheers for that

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

Buy at every drop


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Boagz07 @boagz07 Participant
Summary

This topic contains 11 replies,
has 4 voices, and was last updated by Boagz07
5 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/05/2021
Status: Active
Attachments: No files
Logo Logo
Loading...