fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. trader.philipps
    3. Best
    T
    • Profile
    • Following 3
    • Followers 38
    • Topics 20
    • Posts 1001
    • Best 91
    • Controversial 2
    • Groups 0

    Best posts made by trader.philipps

    • Tutorial Expert Advisor with some recent issues solved

      Here is the Tutorial EA that I recently created and which covers some of the issues that were asked for in the forum. I tried to keep it as simple and structured as possible.

      Disclaimer: This EA is created only for eductaional purposes. It's functions are rarely tested and may contain errors. Using this EA on a real account is strongly not recommanded as the strategy settings are not optimized at all!

      Key Features:

      • Risk Control based on Balance (SL)
      • SL ATR multiplied based
      • ATR based trailing
      • TPs ATR multiplied based (TP1 / TP2)
      • TP1/TP2 visualized by horizontal lines - values will be picked up on terminal restart
      • Close on Opposite signal
      • Close on max. age
      • Limiting trading time
      • Protect from tripple swap

      ToDos:

      • News filter

      Custom Indicators used:

      1. tma-line-extreme-indicator
      2. vq-stridsman_on_jurik2_mtfalerts_nmc
      3. waddahattarexplosion_averages_nmc_alerts_2_1
        Any Credits go to the authors!

      Installation: Unfortunately I cannot upload a zip file, so you must do a little work manually.

      Create a Folder "TMA-EA" in your indicators folder (IMPORTANT!!!) and copy the following indicators into it.

      5_1580504153979_waddahattarexplosion_averages_nmc_alerts_2_1.mq4
      4_1580504153978_waddahattarexplosion_averages_nmc_alerts_2_1.ex4
      3_1580504153978_vq-stridsman_on_jurik2_mtfalerts_nmc.mq4
      2_1580504153977_vq-stridsman_on_jurik2_mtfalerts_nmc.ex4
      1_1580504153975_tma-line-extreme-indicator.mq4
      0_1580504153969_tma-line-extreme-indicator.ex4

      Please rename the files according to the names mentioned above as the forum adds strings as prefix to the uploads. But do not remove the file extensions!
      It should look like this

      0_1580504658092_a8b058c2-9249-4c75-9947-b220b2c0bffc-image.png

      Copy (and rename) the files in the expert folder to the experts folder of your MT4 terminal.
      1_1580504633596_Tutorial-EA_V1.0.mq4
      0_1580504633595_Tutorial-EA_V1.0.ex4

      Currently I do forward tests on M30 timeframe in order to things happen more often. The screen when EA is attached to the chart should looklike this:

      0_1580503834688_aa02ac68-5a26-4eba-a233-50bc47360918-image.png

      You can import the file Tutorial-EA_V1.0.mq4 into a fxdreema project, The result would look like this.

      0_1580505020013_c6866698-f30a-4fb9-bcef-b9d8dfc030db-image.png

      posted in Tutorials by Users
      T
      trader.philipps
    • RE: Stop "Trailing Stop"

      @indaplace2be Try this in a loop "for each trade" filtered for buy trades.

      0_1574529413592_0f35ea85-4028-4c4c-9b92-bc3624512e76-image.png

      If condition is true (orange dot) you'd run the trailing block.

      For sell trades you check if SL is greater than open price.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Call a function for calculating next higher timeframe ** SOLVED **

      I found the solution. I do the following in the on Init tab:
      0_1567721558667_Auswahl_514.png

      The in variables vi_current_timeframe and vi_next_timeframe I defined in variables as integer.

      Here the code if someone wants to do the same:

      //
      int TimeFrames_cust[9] = { 1,5,15,30,60,240,1440,10080,43200 };
      int CurrentTimeIndex = ArrayBsearch(TimeFrames_cust,_Period,8,0,MODE_ASCEND);

      vi_current_timeframe= (ENUM_TIMEFRAMES) TimeFrames_cust[CurrentTimeIndex];
      vi_next_timeframe= (ENUM_TIMEFRAMES) TimeFrames_cust[CurrentTimeIndex+1];
      //

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Read file data

      @ekifox Finally by try and error :))

      Use this for handle:

      //
      int handle = FileOpen(tempFileName,FILE_READ|FILE_CSV|FILE_ANSI);
      //

      Don't ask me why it has to be FILE_ANSI as I saved my file with UTF-8 encoding explicitly.
      However, the result looks like this..

      0_1569458105983_7d7dc2bf-ee91-45bf-8fff-7ec6f78b45ef-image.png

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Store Trade Targets such as TP1, TP2, etc. *** SOLVED ***

      @roar Used the horizontal line approach for now. I will post my work in the tutorial section after some testing (including forward on demo).

      Here are the main features ..

      This project demonstrates how to solve several issues that may occur during building an Expert Advisor. Here are the Key Features:

      • Risk Control based on Balance (SL)
      • SL ATR multiplied based
      • ATR based trailing
      • TPs ATR multiplied based (TP1 / TP2)
      • TP1/TP2 visualized by horizontal lines - values will be picked up on terminal restart
      • Close on Opposite signal
      • Close on max. age
      • Limiting trading time
      • Protect from tripple swap

      ToDos:

      • Volume filter
      • News filter

      That's how it looks like right now.

      0_1580448822418_28561413-6b6e-4cdf-b07e-58c8e69a3b20-image.png

      posted in Questions & Answers
      T
      trader.philipps
    • RE: ENUM in constant declaration ** Solved **

      Try and error. I took a look how the indicator is embedded in fxdreema. Here is an example.

      0_1567876273288_Auswahl_522.png

      It seems like all you need to do is to use the indicator somewhere and than in the constants declaration you use the same syntax.

      0_1567876389212_Auswahl_523.png

      That's it!

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Help needed in modifying values in a sequence

      @rafaels919 Sorry, I mixed up the projects. I meant @roar 's approach.

      I pimped the code a bit to make it more obvious what @roar or I with my answer meant.

      In roar's project he sets the constants like that

      0_1579244004087_fc9f20b3-b6eb-452d-ae0e-4e509eb51f0f-image.png

      Those are 6 values. Roar splits that sequence string into 6 parts (seperator is the comma) and creates an array seq[i]. In the given case the array index has a size of 6. As arrays are 0 based, this means it starts counting by 0 (not by 1). You can read the integer value of each array position in the index like
      seq[0], seq[1], ...,seq[5]

      I print this out in the log and here is the result ..

      0_1579243945176_57e9d83d-976c-46c3-bd7c-afeec8f49654-image.png

      Knowing this, you can at each time go wherever you want in the index of the array by selecting the right index value.
      So if you count your losses by a variable, you can use the array like roar did in the BUY block.

      baseLot * seq[loses]

      0_1579244484479_Auswahl_843.png

      loses is the integer of your losses counter. So if you are at losses 3, it will do like baselot * seq[2]
      Unfortunately there is a glitch in roar's code as the array is 0 based. So if the first value is not 1, it will not match corectly (or in other word works different to fxdreema). But that's not that important.

      Did you get what I mean?

      Again in short refering to roar's version.

      Sequence is: 1, 3, 5, 7
      Startlot is 0.01

      Will result in ..

      seq[0]: 1
      seq[1]: 3
      seq[2]: 5
      seq[3]: 7

      Where the numbers in brackets represent the value of you losses counter.

      Is that clear?

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Help needed in modifying values in a sequence

      @rafaels919 With @roar 's solution you can step back and forth to any position. You may also consider another variable for the sequence position and modify this only and keep the losses variable as is if that makes sense.

      In the concrete case if you want to step back 2 sequence steps, you would
      a) check if losses >2
      b) count losses-2

      In the case you want to step forward you need to ensure that the result is not bigger than the sequence index (roar uses the variable seqLen). And of course always keep in mind that the array is 0 based.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Candle ID for ATR indicator

      @tanjiayi1 Here in short ...

      1. right
      2. also right, but as you are at the very begining of the candle, the result is wrong. If you have a period of let's say 14 it can make a slight difference especially on a daily chart. If you use period 200 or something like that, it won't matter that much. But by principle you should work with closed candles - meaning candle ID1.
      3. Well, I think I answered that in 2 already, but from calculation perspective assuming your ATR period is 14, using candle ID0 means calculation of 13 full candles and 1 with almost no move when you EA opens the trade or checks the condition.
      posted in Questions & Answers
      T
      trader.philipps
    • RE: Symbol from market info without any pre- or suffix

      @roar Okay, will dig deeper into it once news filter is working. Right now I just do this

      0_1580652143435_68cd63df-aff8-4c57-a9bc-182dff9b4d38-image.png

      Thanks a lot!

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Buy/Sell (TP/SL)

      @rafaels919 Check minimum stop level in specifications of the symbol. That varies from broker to broker and may be different for several instruments.

      posted in Bug Reports
      T
      trader.philipps
    • RE: How to close a part of trade if n % of TP in profit?

      @roar thanks a lot. Never used the custom mql block so far. Didn't expect it to be so easy.
      0_1566955947431_c2adedaa-4886-421f-8e0a-4bf5b23658a2-grafik.png

      Thanks a lot.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Fuzzy and Illogical

      @titangeorge Same for me. However, the logic seems to be a multiple zero line cross. The first screenshot only shows 2 lines and the 2nd one 3 lines. My guess is that all have to be above the zero line or below at the same time. But that's only a gues.

      posted in Bug Reports
      T
      trader.philipps
    • RE: TURN Off MT4 Autotrading

      @ambrogio I don't think there is an API function available to do so. At least I'm not aware of.
      If it's sufficient to stop the EA, you may set a flag that you check before opening new trades.

      You may also do so by mql4 code .. see example here https://www.mql5.com/en/forum/113277
      However, they suggest a software that auto-controles the mt4 window. But I have no clue how your EA might trigger that.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: NNFX Template File

      @money123456 I'm not a real MQL4 coder, but I took the challenge to add ATR bands to JMA indicator (token from McGinley). Hence, the work and rights an whatever belong to the people that invented those indicators.
      I tested it and looked good. You may easily just check against the Buffers named "Upper ATR Band" or "Lower ATR Band" in a condition block.
      0_1567530329424_jma_sl_atr_bands.mq4

      Hope that helps you a bit.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Moving average crossover and stochastic error.

      @justintkt I don't think that's the solution for your problem, but check block 4! It doesn't look right.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Buy-Sell EA

      @satoriforex2k18 From what you wrote I understood this:

      0_1568137396200_07325485-14ec-4b02-abc3-c39d00140152-image.png

      But be careful with the spread.

      That means:

      Trailing start: Price has to travel 1000 pips in order to start the trailing
      Trailing step: Price has to mover another 500 pips until next SL adjustment
      Trailing stop: distance from current price, when adjustment takes place

      I use Once per bar as a time filter as it is sufficient for my requirements. You may want to use a different time filter or don't use it.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Read file data

      @ekifox yepp, my result looks similar. It doesn't get the string but a byte it looks like.
      No clue at the moment.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: Time filter

      @marianomartinez In order to avoid unnecessary calculations you should put it as early as possible.

      posted in Questions & Answers
      T
      trader.philipps
    • RE: stopp loss on previous MA cross over candle

      @abubakar The exact value of the cross will be hard to get. But as a workaround you may loop back in order to find the candle where cross happened and take the lower value (buy condition) of the emas.

      posted in Questions & Answers
      T
      trader.philipps
    • 1
    • 2
    • 3
    • 4
    • 5
    • 1 / 5