Stop sell order and Breakeven after Gap Down

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #238293 quote
    Lambo
    Participant
    New

    Hello,

    I would like to test a Short Gap Strategy.

    Here I need help for two points:

    a) I have choosen the 15 minute Chart and want to go short under the first candle low of the day with the gap down. So if the low of the first candle of the day in Dax Future is 18000, the Code should go short if the price is  under 18000 – means 17999. And the order ist guilty for 10 bars. After the time there is no trade, because no short momentum.

    b) Sometimes We see a sharp short move of over 1% and then there is a V-Formation in low and the course climbing strong long. Here I need a breakeven setup. If the course is 1% in profit set breakeven for the trade. Is this possible?

    Thank you very much.

    #238376 quote
    robertogozzi
    Moderator
    Master

    This is the code for your request a):

    ONCE myTime = 090000
    IF OpenTime = myTime THEN
       EntryPrice = low - 1*PipSize
       myBar      = BarIndex
    ENDIF
    IF OnMarket THEN
       myBar      = 0
       EntryPrice = 0
    ENDIF
    IF myBar AND ((BarIndex - myBar) = 10) THEN
       myBar      = 0
       EntryPrice = 0
    ENDIF
    IF EntryPrice THEN
       SELLSHORT 1 Contract at EntryPrice STOP
       SET STOP   pLOSS   50
       SET TARGET pPROFIT 100
    ENDIF

    as to you request b), can you better explain it?

    Iván González and Lambo thanked this post
    #238415 quote
    Lambo
    Participant
    New

    First of all – Thank you very much Roberto.

    b) I want to have a breakeven if the trade ist 1% in profit. Means the trade started on 18000 and the course is now under 17.820. Then i want an stoploss which ist on 18000. (Perhaps in Addition: an Order which close 25% of the position on 17.820. would also be a nice add.)

    I hope this is now a little bit easier to understand.

    Thanks !

    #238427 quote
    robertogozzi
    Moderator
    Master

    This version includes request b:

    ONCE myTime     = 090000
    ONCE PerCent    = 0.5
    ONCE myBar      = 0
    ONCE EntryPrice = 0
    IF OpenTime = myTime THEN
       EntryPrice = low - 1*PipSize
       myBar      = BarIndex
    ENDIF
    IF OnMarket THEN
       myBar = 0
       IF close <= (EntryPrice - (EntryPrice * PerCent / 100)) THEN
          SET STOP PRICE EntryPrice
       ENDIF
    ENDIF
    IF myBar AND ((BarIndex - myBar) = 10) THEN
       myBar      = 0
    ENDIF
    IF myBar THEN
       SELLSHORT 1 Contract at EntryPrice STOP
       SET STOP   pLOSS   150
       SET TARGET pPROFIT 300
    ENDIF
    //graphonprice EntryPrice coloured("Red")
    Lambo and Iván González thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Stop sell order and Breakeven after Gap Down


ProOrder support

New Reply
Author
author-avatar
Lambo @lambo Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
1 year, 3 months ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 09/30/2024
Status: Active
Attachments: No files
Logo Logo
Loading...