Reply

Stop below low of previous candle

24 replies

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #112031

Hi

 

Can anyone help with how I tell EA Wizard to place a stop loss below the low of the 2nd candle back?

 

Thanks

 

 

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #123987

So how do you learn this stuff without a manual or forum replies?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #124020

Hello,

 

this is relatively simple.

You only have to set SL to be at specific price level (in Stop Loss dialog) and choose Low with Shift=2.

 

Low[2] means low of candle 2 bars ago.

 

I’m attaching a sample strategy, I added also configurable offset in pips to set SL few pips below the Low.

 

For that I used variable SLOffsetInPips and function ConvertToRealPips that will convert pip value to “real” pips according to the symbol traded.

Mark
StrategyQuant architect

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124022

Thats great thanks.

 

How can I set the Take profit to be a multiple of the size of the stop loss?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #124024

in a similar way, but you have to use formula to compute the actual SL (Ask – SL level).

 

 

Mark
StrategyQuant architect

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124025

Thanks, can you tell me briefly what the settings mean in the variables..

 

1.  Int

2.  Double

3.  Boolean

4.  String

 

Thanks.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #124027

Int – integer number, for example 1 – 100000

Double – decimal number – 0.23, 4.67, 10234.56

Boolean – true/false value

String – text string

Mark
StrategyQuant architect

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124030

Very helpful, thanks.

 

Im trying to get my head around the Take profit multiplier.  is it like this:

 

1.  Assign variable to  get Stop loss in pips   (open ask – low shift 3)

2.  Assign variable to get the take profit in pips  ( stop loss in pips  *  e.g 2)

3.  Set TP to Ask price + take profit in pips.

 

Is that right?

 

And, do I need to convert 2 into real pips?

 

Thanks.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #124031

Hello,

 

in my example it was like this:

 

1. compute the correct Stop Loss level: Low with shift=2 – X pips offset and storing it to value SLLevel

 

2. Create order, set SL to 

 

You should realize that SL computed in step 1 is a price level, for example 1.6432.

To get SL in real pips you should deduct it from the price at trade open, hence Ask – SL.

For example  let’s say Ask price is 1.6510, then Ask – SL will be 0.0078. This is in “real” pips.

 

 

I realized that I made one mistake – for PT I had to use function ConvertToPips() that converts value from real pips to pips.

 

ConvertToPips(0.0078) = 78 pips

 

Then you can set PT = 2 * this value = 2 * 78

 

I’m attaching corrected strategy.

 

Mark
StrategyQuant architect

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124032

Can you explain

 

 

….   – X pips offset.

 

what does that mean?

 

Thanks

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124033

How do you attach a file here?  I can’t see it!

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124035

Found the attach, you have to use the reply button.

 

Please could you have a look at the attached strategy and tell me what I’m doing wrong with the TP being a multiple of the SL.

 

Thanks

 

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124036

Its ok, ive cracked it.  Just done it.  Thanks for your help.

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124037

one more on this topic..

 

 

If my stop is below the low of shift 2.  How can I make it e.g 3 pips below that low?

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #124071

If my stop is below the low of shift 2.  How can I make it e.g 3 pips below that low?

 

I made this in my example – you can use functions +, -, *, / in EA Wizard.

So to get price level at 3 pips below the Low you can use formula: Low[2] – ConvertToRealPips(3)

 

You should use function ConvertToRealPips() so that your pips value is converted to the correct price value that can be deducted from Low.

Mark
StrategyQuant architect

0

slowbutsure

Subscriber, bbp_participant, community, 63 replies.

Visit profile

10 years ago #124081

Thanks Mark,

 

Im not sure if im getting it right. Could you have a look at the attached strategy.  It doesn’t take any trades, and I think the problem may be around this pip value issue.

0

Viewing 15 replies - 1 through 15 (of 24 total)

1 2