Hi ,
Sorry to be the xth person jumping on you, but you should really try to think the other way around.
Everything, really everything can be done, if you only have a correct base of thinking how the logic “is”. I will try to explain this latter :
If the Chart is 1 minute, inside of the coding you can do ALL you want from 1 minute up to days and beyond (if it is only a multiple of 1 minute in your coding – and you understand that perfectly). So where can it go wrong ?
First off, a Stop Loss, which is a pending order command, is not related to any TF at all. You put it, and it is active. However :
You might want to change it at the higher granularity, which is … 1 minute. Thus, a SL can be reset all right, and thus changed per the 1 minute (the TF of your chart – could also be 5 seconds etc.). Nothing can go wrong …
All what could happen is that you want it the other way around – such as changing the SL (etc. etc.) at the interval of the (1) hour. Well, then you put a TimeFrame command and under the scope of that you reset and change the SL
This is now only about the SL while it could be about anything. And there really really is nothing you can not apply like described above IF ONLY you accept the smaller TF for limiting your backtesting. Thus, it must be clear that using a TF on the chart of 1 minute, brings something like 1440 time (a bit less) length of backtesting. So if you are not afraid of that, then believe me please, all what you want can be done.
Intermezzo : you said Trailing Stop, which is for IB *or* a Pending Stop to begin with, *or* just a Market order, or indeed a SL (Set Stop Loss). For IG the Trailing Stop really can exist. In your later post you started to talk about the SL, which I just dealt with and which can work too, but looks a bit odd to me.
Let’s make it more practical : If you give one concrete example of something you can not do, we will work out that example to a working situation. No need to give code – just description. One thing : you should start your thesis with thinking of the 1 minute (or less) TF of the chart. In the code you have TimeFrame commands (always of longer time than the Chart’s TF, or of the same time as the Chart).
Deal ?