alepan72 wrote:Hi Nikolay!
I love this strategy (mvastop3). I use it for all of my trades. I want to write the code in my strategies, but I have a big problem and I wonder if you can help me...
If I write the code in a tick strategy (like orders) everything is OK. When I include the mvastop strategy into a candle strategy, mvastop3 stop the trade when the price hit an EMA but on close of current candle. Can you tell me how I must write the code, so strategy open a trade on a close candle (e.g. MA_advisor or RSI_strategy) but the mvastop work on tick?
I am grateful if you can me help with the code or if it exists somewhere a document - guide to read.
Thanks in advance
bid = ExtSubscribe(id, nil, "t1", true, "close");
ask = ExtSubscribe(id, nil, "t1", false, "close");
if id == _your_bar_history_id_ then
elseif id == _your_tick_history_id_ then
-- this case will work on every tick!
-- calc stop level here
-- apply stop level here
Users browsing this forum: Apprentice and 1 guest