I am a newbie and have been playing around with a couple of strategies that I have been developing myself.
I am basically looking for a trigger then wanting to go into a trade using EnterShort(0, quantity, "MyShort") or EnterLong(0, quantity, "MyLong").
I call these functions once when the conditions are met from within "OnBarUpdate"
This works fine most of the time but sometimes I get a "Close position" appear on my chart. At this point my strategy becomes say "$-200 Realised" and the trade seems to carry on. i.e. the 'Unrealised' again starts accumulating.
Eventually when the trade reaches the Profit target the trade ends. By that time I could have already lost $600 if I had three of these 'close positions' come up.
I have set the profit and stops in my Initialize routine as follows...
SetProfitTarget("", CalculationMode.Ticks, profit);
SetStopLoss("", CalculationMode.Ticks, stop, false);
I am sorry to be asking such a stupid question but looking for an answer in the help files on this just confuses me more as it seems to be very complicated to just place a simple order.
If you could just point me in the right direction I will really appreciate it.
Thanks
Comment