buy at pivot, sell at resistance 1

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #89497 quote
    Ron HtRon Ht
    Participant
    Junior
    Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
    Res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
    
    if not onmarket and  close crosses over pivot then
    buy 1 contract at market
    sl=low
    sell at sl stop
    endif
     
    if longonmarket then
    sell at sl stop
    endif
    
    
    
    
    if not onmarket and  close crosses over pivot then
    buy 1 contract at market
    res1= 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
    sell at res1 stop
    endif
    
    if longonmarket then
    sell at res1 stop
    endif

    Hello,

    I would like buy if ‘close crosses over pivot’

    and sell ‘if the close hit the resistance 1’

    I use the ‘low[1]’ of entrybar as stoploss

     

    Who can help me? How can i combine it?

    #89503 quote
    VonasiVonasi
    Moderator
    Master
    Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
     
    if not onmarket and close crosses over pivot then
    buy 1 contract at market
    res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
    sell at res1 limit
    entrylow = low
    set stop ploss (close - entrylow)
    endif
     
    if longonmarket then
    set stop ploss (positionprice - entrylow)
    sell at res1 limit
    endif

    Not tested and written after a couple of glasses of wine!

    #89512 quote
    Ron HtRon Ht
    Participant
    Junior
    Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
     
    if not onmarket and close crosses over pivot then
    buy 1 contract at market
    res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
    sell at res1 limit
    sl=low
    sell at sl stop
    endif
     
    if longonmarket then
    sell at sl stop
    sell at res1 limit
    endif

    Thanks for your reaction!

    I change the code to this one^

    It’s look like better.

    #89513 quote
    VonasiVonasi
    Moderator
    Master

    I change the code to this one^ It’s look like better.

    You say tomato and I say tomato.

    #89515 quote
    VonasiVonasi
    Moderator
    Master

    I have moved this topic to the ProOrder Support forum as that is where it should be as it is a strategy coding question. Please try to post in the most relevant forum with future topics.

    #89689 quote
    Ron HtRon Ht
    Participant
    Junior
    if not onmarket and close crosses over pp then
    buy 1 contract at market
    Res1 = 2 * PP - lastLow
    sell at res1 limit
    sl=low
    sell at sl stop
    endif
     
    if longonmarket then
    sell at sl stop
    sell at res1 limit
    endif
    
    
     
    if not onmarket and close crosses over res1  then
    buy 1 contract at market
    Res2 = PP + hl
    sell at res2 limit
    sl=low
    sell at sl stop
    endif
     
    if longonmarket then
    sell at sl stop
    sell at res2 limit
    endif

    Thank you!

    I’m struggling now with the next thing.

    I would like the strategy above combine with ‘buy at res1 and sell at res2’

     

    What is the best way  to combine it in one tradingstrategy?

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

buy at pivot, sell at resistance 1


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Ron Ht @ron_ht Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Ron HtRon Ht
7 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/23/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...