Placing another order 10 points higher or lower

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #8426 quote
    Big Hug
    Participant
    Average

    Hi,

    Just following on from my last post & would be grateful for any input possible.

    I am using a 1 min chart which if a condition is met a Long / Short is action.

    What I would like to do is it to wait 2 min (for example) and then carry out a second trade (accumulate).

    (What I am trying to control here is a signal that holds for 5 minutes and as a consequence – 5 separate trades are initiated all

    more or less at the same price)

    Or

    If the price moves 10 further points carry out another trade.

    Thanks you in advance for any help you can suggest.

    Regards

    BH

    #8439 quote
    Nicolas
    Keymaster
    Master

    Hi, for your first needs, you can use TRADEINDEX which gives you the quantity of elapsed bars since when the last trade opened.

    For your next request, I’ll answer in the other topic 🙂

    #8445 quote
    GraHal
    Participant
    Master

    Would you not have to use ‘Barindex – TradeIndex’ in order to get quantity of elapsed bars since when the last trade opened? Or am I confused again?

    I know you know this Nicolas as it will be ‘2nd nature to you’ and a bit like asking you … how do you breathe! ha

    Apologies for my British humour

    GraHal

    #8452 quote
    Big Hug
    Participant
    Average

    Hi,

    I think I’ve managed to sort it – I’ve arrived at the following code

    IF c1 AND NOT LongOnMarket THEN
    BUY 2 PERPOINT AT MARKET
    ENDIF
    
    //let's add another order taken with a condition of 10 bars elapsed since the first one
    IF BARINDEX-TRADEINDEX(1)>10 AND C1 THEN
    BUY 2 PERPOINT AT MARKET
    ENDIF

     

    This stops the accumulation of orders one minute to the next – but actioned the second Long – which is what I wanted to try and achieve.

    I’ll continue to check for variatons on this and let you know if I come up with any variants.

    Regards

    Hugh

    #8484 quote
    Nicolas
    Keymaster
    Master

    Yes I think you do it right.

    But you take new trade based on time only, not on price so your next buy order could be above or below the open price of the first one. Just for your information.

    @GraHal : this is correct! 🙂

    #8554 quote
    GraHal
    Participant
    Master

    Hi the Hug

    IF BARINDEX-TRADEINDEX(1)>10 means ... If the number of bars in the 'previous Trade' > 10.
    
    Is this what you want?
    
    Or do you want
    IF BARINDEX-TRADEINDEX >10 means ... If the number of bars in the 'current trade' > 10?
    
    Cheers
    GraHal
    
    
    #8557 quote
    Big Hug
    Participant
    Average

    Thanks GraHal,

    You’re welcome to get in touch if you want to exchange some ideas. My email address is ukprtfan@yahoo.com

    #10007 quote
    absent1980
    Participant
    Average

    Hi Guys,

    Can anyone advise on how to code buy order and at the same time to add several market orders to fill if price goes up?

    Thank you.

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

Placing another order 10 points higher or lower


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
Big Hug @big-hug Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by absent1980
9 years, 7 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 05/30/2016
Status: Active
Attachments: No files
Logo Logo
Loading...