automated trading – help with macd cross over 0 value

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #51883 quote
    Amer
    Participant
    Junior

    hope someone can help me. It is possible that when you work with automated trade, you can program the following. example when macd cross over value 0, buy but first 10 pips up. or more exactly put an order 10 pips up when macd cross over 0 value. thanks in advance

    #51927 quote
    Despair
    Blocked
    Master
    once buytrigger=0
    MACDHist = MACD[12,26,9](close)
    if MACDHist crosses over 0 then
      buytrigger=close+10*pipsize
    endif
    if buytrigger>0 then
     buy 1 contract at buy trigger stop
    endif
    if MACDHist crosses under 0 and buytrigger>0 then
     buytrigger=0
    endif

    Here you go.

    Nicolas thanked this post
    #51956 quote
    jebus89
    Participant
    Master

    Hi, im still trying to learn and was wondering what the buytrigger does?
    Not sure what this means: Close+10*pipsize

    also what does this do:

    buy 1 contract at buy trigger stop // Did u mean buy 1 contract at buytrigger? What does the “stop” on the end do?

    #51958 quote
    Despair
    Blocked
    Master

    There should of course be written “buytrigger” in one word. It was separated by the autocorrect function of my computer and I did not read through what I wrote before posting, sorry for that.

    Your other question I’m not sure about. The code does exactly what Amer asked for. When the MACD crosses over zero it put a buy order 10 pips above the close and keeps this level as buytrigger until the MACD crosses under zero again. I think all is correct besides the “buytrigger” which had a space in the middle. 🙂

    #52001 quote
    Amer
    Participant
    Junior

    This is it i think. I will test it and come back with results. Thank you very much.

    Regards Amer

    #52115 quote
    Amer
    Participant
    Junior
    a bit difficult to explain, but what I'm looking for is the same as currently available on automated trading in 
    prorealtime. example macd cross over 0 value 10 periods ago. but in my case I'm looking for distance of 10 pips ass 
    buytrigger insted of 10 periods ago.
    
    #52127 quote
    Despair
    Blocked
    Master

    This is exactly what the code does. It set a buy stop 10 pips about the value of the close when the MACD crossed zero.

    #52233 quote
    Amer
    Participant
    Junior

    thanks again. will test it soon.

    #52262 quote
    Eric
    Participant
    Master

    if it dont work try change the name “buytrigger”

    once trigger=0
    MACDHist = MACD[12,26,9](close)
    if MACDHist crosses over 0 then
      trigger=close+10*pipsize
    endif
    if trigger>0 then
     buy 1 contract at trigger stop
    endif
    if MACDHist crosses under 0 and trigger>0 then
     trigger=0
    endif
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

automated trading – help with macd cross over 0 value


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Amer @amer Participant
Summary

This topic contains 8 replies,
has 4 voices, and was last updated by Eric
8 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/08/2017
Status: Active
Attachments: No files
Logo Logo
Loading...