Reply

How to set custom TP or SL price level

4 replies

jorferbust

Subscriber, bbp_participant, community, 3 replies.

Visit profile

7 years ago #115408

Hi there:

 

I get a problem when I try to set a custom price level for the TP or the SL using this formula:

 

For Long:

 

TP= Highest + (Highest-OpeningPrice)

SL= OpeningPrice – (Highest-OpeningPrice)

 

And is very strange, because when I use this formula as an “IF close condition” ( For example: IF Bid>Highest + (Highest-OpeningPrice) THEN ClosePosition) , instead of placing the TP and SL orders, it works.

 

Any idea what I´m doing wrong?

Maybe a bug?

 

Thank for your help!

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #138610

Hello,

 

could you also upload the Wizard project file? (SQW)? I can have a look into it

0

jorferbust

Subscriber, bbp_participant, community, 3 replies.

Visit profile

7 years ago #138613

Sure!

 

The version is not yet complete, but you can check the long entry at “Entrada Largos” tab.

 

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #138634

I think the problem exists with your long order because you are referencing OpenPrice(1000) which does not exists at time you send your order into the market (you have no position to get the price from yet). Hence the calculation of PT and SL is incorrect so MT closes such trade immediately .

0

jorferbust

Subscriber, bbp_participant, community, 3 replies.

Visit profile

7 years ago #138665

Thanks for your help! I didn´t know I couldn´t refer to OpenPrice(MagicNumber) inside the same Market Order that determines the MagicNumber to calculate TP and SL.

Is good to know! 🙂

0

Viewing 4 replies - 1 through 4 (of 4 total)