I added this MM script to my strategy, that disables the Stop Loss orders in the strategy after N bars. I set it to 2, because i have other Exit Rules that exit more profitably after 2 bars. http://www.quantshare.com/item-1159-stop-mgmt-v-11
This MM script seems to disable all Stop Loss orders even on the first few days, as no Stop Orders are generated - i tested with N=10 or 20, but same issue.
Below is the code (quite small) - is there some bug in it?
OnStartSimulation
-------------------------
Functions.SetNumericInput("Number of Bars", 10, "Number of bars to keep the Stop Loss active");
I see no issue in the code. it should be working and disabling stop loss only after "nbdays".
How are you entering orders? Using the script editor (QS language) or money management script?
Orders are entered in the script editor - I have a Stop Loss order (sl*TickSize(), where sl is a parameter from 2->10) and a formula-based Sell Limit and Buy Limit orders.
The MM script seems to disable Stop Losses because none of the trades in my simulation are Stop Loss even if i have it enabled for multiple bars.
When i delete the MM script, i see Stop Loss executions with 1-2 bars (which should have triggered with the MM script).
-> I noticed that the StopLossEnabled flag is not prompted by the C# code-prompt when i click 'ctrl-space' , so i was wondering if the code is unsupported/legacy.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.