MACD histogram height

Forums ProRealTime English forum ProOrder support MACD histogram height

Viewing 12 posts - 1 through 12 (of 12 total)
  • #126462

    Hello all.  Fairly new to this PRT etc. coding.

    The following code shows no errors, but does not work. I am trying to minimise the sea-saw effect (the back and forth over ‘0’ in the MACD simplified indicator).

    For a buy

    When the MACDline crosses over 0,  and the histogram is higher than 0.00025 within 5 candles of the crossover

    It will start the trade. As I said before, but the histogram height does not work.

    It opens the trade whether the height is above or below the histogram height

    Can someone please help/advise me. Many thanks

     

    #126467

    There are some simple rules that everyone using the forums is expected to follow. Your post has broken one or more of these rules.

    The forum rules are as follows. I have highlighted in bold the rule/rules that you have not followed:

    Post your topic in the correct forum.

    ProRealTime Platform Support          only platform related issues.
    ProOrder                                                only strategy topics.
    ProBuilder                                              only indicator topics.
    ProScreener                                           only screener topics
    General Discussion                               any other topics.
    Welcome New Members                      for new forum members to introduce themselves.

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
    Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
    Be careful when quoting others in your posts. Only use the quote option when you need to highlight a particular bit of text that you are referring to or to highlight that you are replying to a particular member if there are several involved in a conversation. Do not include large amounts of code in your quotes. Just highlight the text you want to quote and then click on ‘Quote’.
    Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.
    Do not include personal information such as email addresses or telephone numbers in your posts. If you would like to contact another forum member directly outside of the forums then contact the forums administrator via ‘Contact Us’ and they will pass your details on to the member that you wish to contact.
    Always be polite and courteous to others.
    Have fun.

    I have edited your post where required. Please ensure that your future posts meet these few simple forum rules. 🙂

    #126469

    Add the following to the bottom of your code and you will get some clues as to what is going wrong.

     

    #126826

    Thank you Vonasi.

    The graph has highlighed the error.

    Process      1. Macd crosses over 0.         2.Macd histogram is above 0.00025

    Item 2 is not working. The formula is not correct or used, and the program opens regardless whether it is above or below histogram height.

    The attachment shows 2 trades, one of which is open in demo mode. They both were below 0.00025 when opened and one was just over 0.

    Any ideas of how to fix the formula greatly appreciated.

    regards Trevor

    #126839

    Have you tried using Cursor Details to see EXACTLY what that histo height is on the bar the entry conditions are met (the bar before actual entry bar)?

    Unless I am missing something, the histo height appears to be above  0.00025 when the macd line crosses 0?

    Right click, Display, Cursor Details and tell us exactly what the height of the histo is?

    #127000

    You should use integer for your MACD periods, the problem might come from rounding differences in the EMA calculation used in the MACD formula.

    #127160

    Thank you GraHal for your suggestion. Have used the cursor details window and the Histogram Height is not above 0.00025 or below for the sell -0.00025.

    And thank you Nicolas also. I have tried the integers of MACD[12, 26, 9] (close), instead of the formula MACD[37/3, 77/3, 9] (close). It did not change anything.

    I rewrote the code. Mainly looking back the 5 candles.  indicator2, the MACD, is formulated to be the histogram height.

    Changed the minimum height of the histogram to 10, which it almost never is in forex, to illustrate that indicator2 does not work.

    The trades open whether the histogram height is 0.000001 or whatever.

    How does the backtest have a result if the histogram height is never correct?

    The attachment shows a trade opened by backtest with the MACD Line minus signal at 0.00016 shown in the cursor details window.

    Any help or suggestions appreciated.

     

     

    #127178

    The red line on the MACD chart is the MACD signal line and not the MACD line.

    Also having the same variable (c1 and c11) defined differently five times in a row will not work – it will simply use the last version of definition.

    #127348

    Thank you Vonasi, for your help. I have corrected the code. The MACD is the histogram height and that is what I now use.

    But when I run the code, it still trades when the MACD line minus signal (9) is under the +or – 0.00025.

    What is wrong with my code? Help me please.

     

     

    #127371

    This PRT code does not work.  Code created by simplified creation. See attachment error3

    I then switched to creation by programming and copied that to my code(attachment error4).

    The full code-

    This is the PRT code created through their program. It still opens trades but 5 of the 12 trades are outside +or- 0.0003. See third attachment

     

    This is the part that is not working. Copied from ‘creation by programming’

    Can I get a hand with this error please.

    #127385

    Can you do what Nicolas told you to do and ditch the 37/3 and 77/3 from your MACD and MACDLINE instructions. The instructions should have only whole integers only.

    Also I notice that your displayed indicator is the MACD Simplified and not MACD. They are different MACD calculations. Your ProOrder code is using the latter while you are comparing the results to the former.

    #127399

    By GRAPHin your variables in backtests, you will find many interesting information. Firstly, compare the MACD from the backtest and the MACD indicator on the chart.

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login