TakeProfit invalid value on large distance

Posted By: marr

TakeProfit invalid value on large distance - 02/26/21 09:43

I have a formula where I set TakeProfit to 200% of entry price

```
TakeProfit = priceClose() * ((target/100.0)+1.0); // 200% target
enterLong();
```
when i run this live i get this error `Error 010: Invalid TVKBUSD TakeProfit: -213016833

while if i print the value of the formula it returns the right number

how do i resove this issue?
Posted By: MatPed

Re: TakeProfit invalid value on large distance - 02/26/21 14:38

I do not understand: if your entry price is 1.5 do you want to exit when price is 3.0? If that is the case just compare the price, do not use the TakeProfit
Posted By: marr

Re: TakeProfit invalid value on large distance - 02/27/21 17:35

I just don't understand why TakeProfit did not work as described on documentation
Posted By: jcl

Re: TakeProfit invalid value on large distance - 03/01/21 16:08

Zorro issues an error message when stop loss or TP exceed twice the current price. It assumed that this was a programming error. Maybe that was a bit too protective. We'll make that less restrictive in future versions.
© 2024 lite-C Forums