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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Stop Loss vs. Hidden Stop Loss 26 replies

EA Advisors????HUH??? 2 replies

Jpy Huh ! 15 replies

Huh?? 13 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Stop loss = 1? huh?

  • Post #1
  • Quote
  • First Post: Mar 30, 2009 2:31pm Mar 30, 2009 2:31pm
  •  trader346
  • | Joined Oct 2008 | Status: Member | 43 Posts
Hello Guys,

You've been very helpful but wondering if you could help explain this...

When I run my EA, the print command shows me the value for var3 (my stop) is "1". How does it come up with this number?


Here's the output line:
Recmax: 1.9859 Recmin: 1.9782 Stop: 1

Im expecting the value to be 50 points less then Recmax which would be like 1.9359



==========
Code
==========



int var3 = NormalizeDouble(RectanglePriceMax,Digits)-500*Point;

OrderSend(Symbol(),OP_BUYLIMIT,1,NormalizeDouble(RectanglePriceMin,Digits),3,var3,NormalizeDouble(RectanglePriceMin,Digits)+500*Point,"Order Sent", 16384,0,Green);


Print("Recmax:", RectanglePriceMax, "Recmin:", RectanglePriceMin, "Stop: ", var3, "This is for the bullish pattern");
Know your indicators!
  • Post #2
  • Quote
  • Mar 30, 2009 2:39pm Mar 30, 2009 2:39pm
  •  Trk
  • Joined Jan 2008 | Status: Member | 226 Posts
is that an error you made posting here or is there actually a gap in your code
here : int var3 = NormalizeDouble(RectanglePriceMax,D igits)-500*Point;

its supposed to be Digits...
 
 
  • Post #3
  • Quote
  • Mar 30, 2009 2:52pm Mar 30, 2009 2:52pm
  •  trader346
  • | Joined Oct 2008 | Status: Member | 43 Posts
Hmm I donno why when i copied it that happened, but I took out that line and put it into notepad and there was no spaces, so retyped it in manually... but ran it and got the same value of 1 ... hmmmm
Know your indicators!
 
 
  • Post #4
  • Quote
  • Mar 30, 2009 3:08pm Mar 30, 2009 3:08pm
  •  ubeee
  • | Joined Oct 2007 | Status: EURUSD 1.9999/2.0000 | 94 Posts
Quoting trader346
Disliked

Recmax: 1.9859 Recmin: 1.9782 Stop: 1

Im expecting the value to be 50 points less then Recmax which would be like 1.9359

...

int var3 = NormalizeDouble(RectanglePriceMax,Digits)-500*Point;
Ignored
Hi, trader346, the error is that you declare var3 as an 'int' but assign a double value to it, so it gets truncated to an integer (in this case to '1').

Try this:

double var3 = NormalizeDouble(RectanglePriceMax,Digits)-500*Point;
.Ubeee.
 
 
  • Post #5
  • Quote
  • Last Post: Mar 31, 2009 1:00pm Mar 31, 2009 1:00pm
  •  trader346
  • | Joined Oct 2008 | Status: Member | 43 Posts
wicked, thanks so much!
Know your indicators!
 
 
  • Platform Tech
  • /
  • Stop loss = 1? huh?
  • Reply to Thread
0 traders viewing now
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • 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 / ©2022