
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I've written a function that I'm setting up to slowly reduce a profit target on a basket of trades.
I have a variable set up
input string ExitStrategyAsian = "00:00-1;08:00-0.9,08:30-0.8,09:00-0.75,09:30-0.65,10:00-0.50,10:30-0.40";
The theory is that every 30 minutes ( or whatever interval I want ) it sets a new scaling factor which is then used by a closing function to try and exit a basket of trades.
The function I have written is below.
I send it the current DailyProfitTarget ( which might be 1% ) and a target for each instrument ( which could be 0.5% ) and the exit strategy variable ( above )
At the moment it's not always calculating the correct value based on the current market watch time.
Can anyone spot where I've gone wrong please? Thanks!
( CreateLabel is a custom function used to show the result on screen )