READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

Calculating Profit Target

2 replies

ssdex

Customer, bbp_participant, community, 99 replies.

Visit profile

11 years ago #113402

Hello,

 

I’m trying to calculate the profit target to be the same distance as the SL. I’ve had a two issues trying to do this.

 

First:

On the pending order I have in the Stop Loss setting OpenPrice(magic#). This doesn’t seem to be working like I assumed.

 

Second:

In the Profit Target setting I have–

((OpenPrice(9) – OpenPrice(10)) + OpenPrice(9)

 

When doing the math on the calculator the price comes out correct. But the EA Wizard doesn’t set any SL nor PT for these. 

 

This seems like it should be simple math. Any suggestions on how to fix to get the correct SL and PT?

 

Thanks for your time.

 

James

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

11 years ago #129060

the problem is that these functions are called before the order is placed, so in live trading they don’t know what is the open price.

 

It can be used by a separate rule – create a rule that checks that order is open and its Profit Target is 0, then you can get its open price or stop loss and compute & set profit target

Mark
StrategyQuant architect

0

ssdex

Customer, bbp_participant, community, 99 replies.

Visit profile

11 years ago #129076

Thank you Mark. I should have thought of that. I’ll make a rule following the entry to adjust the PT. Thanks again.

0

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