Results 1 to 1 of 1
 1 Attachment(s)    

Thread: Got stuck on my EA (ADX,PSAR)

  1. #1
    Junior Member
    Join Date
    Oct 2017
    Posts
    1

    Default Got stuck on my EA (ADX,PSAR)

    Hello everyone,

    I have been following this forum for a while now as I recently started to get into MQL4 and I am currently working on my first EA. As you can guess, this is not working out too well (which was the reason I decided to finally sign up and simply ask for help). Right now, my guess is that I got a logic error in my code which I am simply not able to identify. Of course I tried commenting out some of the conditions to open a buy/sell order, but it won't open any order.

    Signals for SendOrder:
    - check for signal of ADX
    -- buy: adx_plus > adx_minus
    -- sell: adx_plus < adx_minus
    - confirm by PSAR
    -- buy: PSAR < current price
    -- sell: PSAR > current price
    - check for ADX strength > 20
    - filter: last period PSAR compared to current PSAR
    -- buy: PSAR_filter > current PSAR
    -- sell: PSAR_filter < current PSAR
    - check if no Orders are open yet (therefore automatically limit total orders to 1)

    OrderModify:
    - select open positions
    - split by Magic Numbers (assigned when opening orders)
    - trail StopLoss based on PSAR and ATR
    -- buy: new StopLoss = PSAR+ATR
    -- sell: new StopLoss = PSAR-ATR

    I originally intended to let it trade only once per Bar, but I commented it out for the moment as the code is not working at all.

    What I already tried:
    - once per bar part commented out (currently the case)
    - less conditions to fullfill
    - lower conditions (e.g. strength of ADX_main signal to > 1)
    - rephrased NormalizedDouble for my StopLoss and TakeProfit
    - proof-read if I find any mistakes I have in my logic

    Long story short: All didn't work. Is anybody able to tell me where I went wrong? Or what I did that I cannot do? I somehow have the feeling by now, that my structure is not done properly and I need to divide it up a bit into separated functions. Not to forget: This is on MT4 and written in MQL4.

    Thank you in advance
    - Chris
    Attached Files Attached Files

Similar Threads

  1. Backtest EA stuck
    By oGladiatore in forum Expert advisors backtesting
    Replies: 1
    Last Post: 10-27-2015, 15:58
  2. 4tf psar EA
    By yazdanibalan in forum Ideas for expert advisors
    Replies: 0
    Last Post: 12-24-2014, 00:23
  3. PSAR RSI EA
    By funyoo in forum Expert advisors backtesting
    Replies: 0
    Last Post: 05-11-2010, 22:18
  4. psar EA
    By MikeT. in forum Ideas for expert advisors
    Replies: 0
    Last Post: 01-15-2010, 09:23

Tags for this Thread

adx, automatically, bar, based, beginner, buy, check, code, conditions, error, expert advisor, filter, finally, forum, intended, limit, logic, lower, magic, main, mistakes, mql, mql4, mt4, period, psar, select, sell, short, signals, star, stoploss, strength, total, trade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •