StopLoss EA Coding Samples

 

Dear All,

Could anyone point out to me a sample for StopLoss coding. I'm planning to include it on my first EA product.

Thanks in advance.

 

When you say 'product' do you mean you're going to attempt to sell it? And you don't know how to code a stoploss? No offense but if you can't program something as straightforward as that I can only imagine how good the quality of your 'product' will be.

Good luck

Lux

 
luxinterior:
When you say 'product' do you mean you're going to attempt to sell it? And you don't know how to code a stoploss? No offense but if you can't program something as straightforward as that I can only imagine how good the quality of your 'product' will be.

Good luck

Lux

Lux

Have you not discovered yet that it makes no difference if it works or not theres people out there that will pay big bucks for a good sales pitch. been thinging of selling some of my work too, only the stuff that doen't work. The good stuff I will keep to myself.

 

CC you're so jaded and cynical...I LIKE it! Just like me.

Lux

 
cencurut:
Dear All,

Could anyone point out to me a sample for StopLoss coding. I'm planning to include it on my first EA product.

Thanks in advance.

here some of coding example ;

extern double StopLoss = 0.0;

.....

....

double l_price_12;

..................

..................

if (StopLoss == 0) l_price_12 = 0;

else l_price_12 = NormalizeDouble(Ask - StopLoss * Point, Digits);

if (OrderSend(Symbol(), OP_BUY, LotsOptimized(), Ask, slippage, l_price_12, l_price_4, "M buy", Magic, 0, Blue) > -1) gi_180 = FALSE;

PlaySound("alert.wav");

.......

.......

best of luck,

MANSTIR

 

Okay ... maybe some of you might be cynical... but..

When I said it "a product", I didn't even said that I want to sell it. It just for my personal use only. For me, I don't believe that everyone should sell their EA even if it work for them. EA should always remains as personal as it should be.

EA should be use to test the system (back test) and it is not wisely to be use by a newbies (making money out of forex trading without any proper trading knowledge). I'm against the use of EA for newbies.

No offense to everybody, as I said earlier, EA should always be use to test the system (i.e backtest) and "scientific research and academic use only" and not for every Jack and Jane automatic trading usage.

 

stop loss base on the next low

Can you please put an example of stop loss based on next higher low and next lower highs?

if is uptrend move the stop loss 10 pips below the next lower high for downtrend the opposite.

Thank you

MANSTIR:
here some of coding example ;

extern double StopLoss = 0.0;

.....

....

double l_price_12;

..................

..................

if (StopLoss == 0) l_price_12 = 0;

else l_price_12 = NormalizeDouble(Ask - StopLoss * Point, Digits);

if (OrderSend(Symbol(), OP_BUY, LotsOptimized(), Ask, slippage, l_price_12, l_price_4, "M buy", Magic, 0, Blue) > -1) gi_180 = FALSE;

PlaySound("alert.wav");

.......

.......

best of luck,

MANSTIR
Reason: