fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. malfy
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 19
    • Best 1
    • Controversial 0
    • Groups 0

    malfy

    @malfy

    1
    Reputation
    767
    Profile views
    19
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    malfy Unfollow Follow

    Best posts made by malfy

    • RE: Counter to check past candles conditions

      Thanks Roar,

      Your workaround it's certainly less complicated but is not what i want, because you are counting each bar waiting for the condition to buy, while i want a "picture" of X past bars at every new bar.
      Anyway you suggested me where to focus my attention, and i discovered that i was using the wrong counter block. Using Loop (Pass "n" times) it works!

      That's the right version:
      https://fxdreema.com/shared/z2aQGGpae

      posted in Questions & Answers
      M
      malfy

    Latest posts made by malfy

    • Pair trading suggestions

      Hi There!
      @miro1360 i think i'm going to challenge your skills...

      My broker offers microlots tranding on CFDs like SP500 and Nasdaq. These 2 symbols both move by 0.01 as minimum step and have the same pip value.
      This conditions are perfect for a pair (or spread) trading experiment that can be very profitable (because normally most brokers don't allow microlots so you need big margins to match the pip values of 2 CFDs finding the correct trade volumes.. and there are no currencies being so strictly correlated).

      So the problem is... to create an EA that can trade this strategy, some measurements are needed and i think i have to create something like a "spread" indicator. At first glance I suppose it's impossible to track the relative movement of 2 symbols which have different prices, but it's possible to do it fixing a certain point in time. The idea is this: Nasdaq moves faster than SP500... so, if i recognize that Nasdaq spreads from SP500 more then the middle value of the last x candles, i open a Nasdaq position toward the mean revertions and the opposite position on the SP500.

      My intention is to create a lookback period, to use a cycle to check candles from this period to 1, check the single candles combinations of the 2 symbols (I mean... Symbol A Bull-Symbol B Bull, Symbol A Bear-Symbol B Bear, Symbol A Bull-Symbol B Bear and Symbol A Bear-Symbol B Bull) and then calculate the spread by simple addiction or subtctration of candles close price. (A tick by tick comparison would be better but i think is too complicated to do it).

      Once i have a single candle spread i can then add or subtract the value to the next candle spread, depending on the bear/bull combination and which symbol has generated the biggest candle, and then plot these values as positive or negatives horizontal segments or rectangles... like an histogram... Not an easy task but i think i can do it.

      The major problem is: once i have these values, how can i tell the EA to recognize a mean spread value for the traced period and to open a position when this value is reached? About this point i'm in a big trouble and i hope someone can suggest me a smart idea!

      Thanks!
      D.

      posted in Questions & Answers
      M
      malfy
    • RE: Counter to check past candles conditions

      Thanks Roar,

      Your workaround it's certainly less complicated but is not what i want, because you are counting each bar waiting for the condition to buy, while i want a "picture" of X past bars at every new bar.
      Anyway you suggested me where to focus my attention, and i discovered that i was using the wrong counter block. Using Loop (Pass "n" times) it works!

      That's the right version:
      https://fxdreema.com/shared/z2aQGGpae

      posted in Questions & Answers
      M
      malfy
    • Counter to check past candles conditions

      Hi there!

      I'm trying to realize this idea: if a certain number of past bars closed below the middle bollinger band and the last bar closed above, then buy.

      I tried to do this using a counter "Count n then pass". The idea is this: if i want to count 5 bars under bollinger middle line i need to check 6 bars... 5 under bollinger and 1 above bollinger, so i set a constant (COUNTER CYCLES) equal to 6-2=4. Then i set a variable (ID) equal to the (COUNTER CYCLES)+2.
      The counter should check the condition Candle Close < Bollinger Middle at the candle ID = (ID), if is true, set (ID)=(ID)-1. When the counter passes, If all the past candles closed below the bollinger then (ID) must be == 2 and i just have to check if the last candle closed above and eventually buy.

      This is the project: shared/1g4dy10Hc

      My problem is that the variable (ID) goes immediatly to -1 which should be impossible... if the counter passes 4 times and (ID) is initialized to 4+2 it should never go under 2. I can't get the reason.
      Probably i did a wrong use of the counter. To realize this idea i connected to the yellow dot a "run blocks" command to run the candle condition check.

      Can someone tell me where i'm wrong?

      posted in Questions & Answers
      M
      malfy
    • Closing oldest trades on specific event

      Hi there!

      I want to test a trading system where losable trades are never closed unless they are compensated.
      To do this, when i open a new trade i also open an opposite pending at the distance of my wanted "stop loss". In this way, when the trade goes bad, i freeze the loss by hedging. Then, every new trade has a trailing stop with same size of the pips distance between each hedging couple. What i want to do is to close the oldest couple of hedging trades each time that the trailing stop moves the SL.
      I wrote the system and it seems to be ok unless that i can't close the oldest couple of orders.
      I tried to realize it using a "trade SL modified" under "on trade" section. I connected a loop to this block where the sequence is: for each trade, oldest to newest, no more than 2 trades, close trades... but this is not working
      I also tried to place the same loop "on tick", with using other ways to identify the condition where oldest orders must be closed but i have no results.

      Where is the mistake? Or... what could be the right way to achieve the result?
      Here the link to the project: https://fxdreema.com/shared/obdqfrjjb

      Thanks for the help and happy sunday!
      Malfy

      posted in Questions & Answers
      M
      malfy
    • RE: Keeping data after a crash

      Thanks FxDreema,
      i get your suggestion. Unfortunately i need at least one data (the last closed trade profit) to be stored somewhere.
      I'll try to study the terminal variables or maybe i can write it in a log file and use a constant that in some ways overrides the EA if contains a value greater than 0.

      I'm a bit in trouble about reading the last closed trade profit. The "Check Profit" block only compares the profit with a value.
      Can i use a formula with "(On trade) Event Data" - Profit, or the only way is to compare the current balance to the last balance?

      posted in Questions & Answers
      M
      malfy
    • Keeping data after a crash

      Hi there!

      I'm thinking about a special money management that makes calculation on each single trade profit to evaluate the risk for the next one. In order to do this, i need to act in relation to the starting account balance when the EA is attached to the chart for the first time, and i also need to always have the last trade data in a variable.
      But... an EA like that needs to keep some data that can be lost in case of a system crash or if a platform restart is required for any reason.

      There's a way to store these data somewhere and tell the EA to read them when is restarted?

      posted in Questions & Answers
      M
      malfy
    • RE: Lag between EA and server

      I found out that the VPS time is 5 seconds earlier than broker's time. So that's the reason... and this also means that "GMT" option in the hout filter block is related to the local machine. I will change it to "server" and i'll add a GMT correction constant or... maybe, i guess i can set a formula and a variable to read the market conditions and automatically align the server time to the local machine time đŸ™‚

      posted in Questions & Answers
      M
      malfy
    • RE: just losses

      When you look for this strategy on the net, you find that someone says to start measuring the night range from 23.00 of the previous day, someone else says you just need 4 hours before the session opens... someone else talks about just half an hour before.
      So... the better thing to do, imho, is to assign a constant to the candle ID that you are looking back. In this way you can do multiple backtests or run the optimization to find what value works better.
      Same for the start time... you can see if is better to shift it a little backward or a little forward.
      Nothing changes about the EA behaviour, it's just a matter of tweaking it.

      posted in Questions & Answers
      M
      malfy
    • RE: Lag between EA and server

      @fxDreema yes you're right, i have 2 EA working on the same demo account. The problem can be related to this?
      I know about the local/server option but i chose the third one... "GMT", because i hoped to be always in sync with the London session without caring about the server time zone.

      posted in Questions & Answers
      M
      malfy
    • RE: Place 3 Break even

      Sorry i was wrong... To do this it must be Trailing Stop = 15, Trailing step = 10 and Trailing start = (Open Price - 5).

      Try it. If you want to stop trailing the stop after 40 pips you should think about something like a flag to be checked after the profit reaches 40 pips.

      posted in Questions & Answers
      M
      malfy