Hi there!
Apprentice can you assemble two existing strategies into one new strategy for me?
The 2 strategies are the " Manual Entry Strategy.lua" (MES) and the "Chandelier trailing stop Strategy.lua" (CTS).
The MES is very useful to determine BreakOut Entries. I changed the signal code into several versions but the general clue of the indicator is always the same: if the second-to-last price is above a given level and the last price is below then SELL - vice versa for BUY.
Also MES allows to place an Initial Stop and a Target Exit.
Once MES has opened a position you have to handle the position. As with any trade you can leave the STOP where it is waiting to be stopped out or waiting until your Limit gets executed. Or you can trail the STOP manualy or apply a Trailing Stop Strategy, whatever.
Problem with MES is that you have to be on the monitor to do all that.
Another downside: if you don't watch what's going on it may happen that MES opens a trade, the trade gets stopped out, the price hits the Entry criteria again - and MES reopens a new trade. And so on. Some poeple may find that useful but I don't. If I get stopped out I normaly won't entry that same trade again couple minutes later.
Now, my request is the following.
Once MES has opened a Trade:
1. MES should activate CTS
2. MES should BLOCK ANY NEW ENTRY after the initial Entry has been stopped out.
In other words, it should shut off.
3. a working Mandatory Closing (I found some Strategies with Mandatory Closing options on the codebase but none worked)
4. a Mandatory Opening
Regarding point 4: I leave the house at 8 o'clock in the morning but before I leave I activate MES to entry a trade at a given level. At say 2 PM the price meets that level and MES opens the trade...
But at 2:30 PM important economy numbers are scheduled in America. I don't want MES to open that trade 30 minutes before the numbers get out.
So a Mandatory Open should provide the option to open a trade >= 2:45 PM.
This is an example for how I changed the signal code for the Short side:
if Source.close[period - 1] < Entry and
Source.close[period - 2] >= Entry
then
if Direction then
SELL();
end
ONE= Source:serial(period);
end
A Mandatory Open >=2:45 PM allows MES to open a position on 2:45 (if criteria is met at 2:45) or 3 PM (if criteria is met) or 3:15, 3:30 and so on - but at no Bar CLOSE before 2:45 PM!
Regarding point 1: when MES opens a trade, say a SHORT, CTS may still be pursuing the LONG side. Obviously MES only can activate CTS once CTS flips to the SHORT side too - until then the Initial STOP remains untouched.
That's it.
Apprentice, can you do that for me?