Hello,
I have been working on a backtesting strategy which sets profit & stop targets based on a certain calculation. The calculation obviously give me a price to put in as the target. But, apparently i can only set an amount as Profit or Stop target. This is pretty difficult to work with as it makes validating the code very difficult. Is there another way around this? May be able to put in price targets?
Any sort of help would be welcome.
Thanks.
Umer
Setting Profit & Stop Targets [SOLVED]
- master.aurora
- Posts: 33
- Joined: 21 Jan 2013
- Location: Islamabad
- Has thanked: 6 times
- Been thanked: 3 times
- Contact:
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Setting Profit & Stop Targets [SOLVED]
Hello Umer,
The easiest way in this situation is to send limit orders at a certain price instead of profit targets.
Alternatively you can create a logic to convert the price value you have into the amount of profit acceptable by GenerateProfitTarget.
The easiest way in this situation is to send limit orders at a certain price instead of profit targets.
Alternatively you can create a logic to convert the price value you have into the amount of profit acceptable by GenerateProfitTarget.
- master.aurora
- Posts: 33
- Joined: 21 Jan 2013
- Location: Islamabad
- Has thanked: 6 times
- Been thanked: 3 times
- Contact:
Re: Setting Profit & Stop Targets
When using the portfolio backtester, how can we follow this approach of limit/stop orders? We can only send them once we know that our original entry order has been filled. But, as far as i know, there is no way of finding out whether an order has been filled or not while using the backtester.
Please advise.
Thanks,
Umer
Please advise.
Thanks,
Umer
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Setting Profit & Stop Targets
Do you mean you send these exit orders only if market position is <>0 ?
This logic works in both realtime and backtesting.
This logic works in both realtime and backtesting.