• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 3:35am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 3:35am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Help - any tools that can easily convert MQL4 code to Easy Language code? 7 replies

2 simple lines of code needed, please help 18 replies

Help needed to code Parabolic SAR EA and test it 2 replies

Simple close script - some help with code needed 2 replies

Help needed - Metastock Code to Tradestation 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Code Help Needed
Exit Attachments
Tags: Code Help Needed
Cancel

Code Help Needed

  • Post #1
  • Quote
  • First Post: Edited Nov 27, 2012 7:17am Nov 26, 2012 11:39am | Edited Nov 27, 2012 7:17am
  •  pgtips
  • | Joined Nov 2007 | Status: Member | 162 Posts
Hi Everyone,

I've run into a wall with code and need some help to understand what is wrong with it. I'm no programmer by the way but I didn't really think this would be that difficult but its stretched me and I'm making it worse.

Its close EAs originally based on code by a clever programmer called Kimi.

It is cycling through all the open trade orders to set stops, but it doesn't apply the close half bit and I don't know why.

The idea is it sits on one chart and manages (cycles through) all open trades past and present whatever their state.
If there is no SL it puts a SL in place (which seems to work ok)
If the trade moves up a bit then it can adjust the SL a bit.
Once a trade (any trade on any chart/pair) hits + xx pips it should close half and set SL to BE.

But I run into several problems, one attempt I made it just went crazy and closed all trades, I tried to introduce a condition if orderlots() > preserve_lots to stop it closing everything but then I found it was ignoring trades so I think I've gone a long way backwards.

Would anyone be kind enough to cast their eye over this and show me where I am going wrong I've got my self really confused.

Code is attached.

## Or, is it possible (better if it is possible) to change the e MoveSLTP by mouse code attached to close half, i,e you can set TP to 50%, not the full close out. I looked for order lots in the code but it is not there so I don't know how to change it.

and a big thank you in advance if anyone can help me with either of these.

PG
Attached File(s)
File Type: mq4 close_half.mq4   6 KB | 117 downloads
File Type: mq4 e-MoveSLTPbyMouse.mq4   16 KB | 109 downloads
  • Platform Tech
  • /
  • Code Help Needed
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023