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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Help to debug my EA 2 replies

Help Needed to Debug Existing EA with proven strategy 759 replies

Debug code in strategy tester 1 reply

Debug this Indicator please 2 replies

debug message MT4 EA in Strategy Test 7 replies

  • Recycle Bin
  • /
  • Reply to Thread
  • Subscribe
Tags: help to debug my trailing EA
Cancel

help to debug my trailing EA

  • Post #1
  • Quote
  • First Post: Edited 10:48am Sep 25, 2019 9:31am | Edited 10:48am
  •  pgtips
  • | Joined Nov 2007 | Status: Member | 162 Posts
Hi,

need some help with my code
I'm trying to do 2 things, trail my open position when it goes into profit by x pips and execute trailingpositions routine

then when price hits + 30 (level set externally by LevelTargetInProfit then use a different trailing routine trailingpositions2

/+------------------------------------------------------------------+
//| Trailing levels |
//+------------------------------------------------------------------+
void CheckPriceAboveorBelowLevel() {
int pr=ProfitPosition(), sl=StopLossInPoint();
int sp=MarketInfo(OrderSymbol(), MODE_SPREAD);

if (pr<LevelTargetInProfit && pr>=-3000 ) {
TrailingPositions();
return;
}

if (pr>LevelTargetInProfit ) {
TrailingPositions2();
return;
}
}

what am I doing wrong ? I need it to trail immediately?
Must I set a SL to start or will MT4 it apply one.
  • Recycle Bin
  • /
  • help to debug my trailing EA
  • 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