For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Complex trading logic



  • Hello,
    I have a system prototype which uses break even and the trailing exit - which is activated on the future value of an indicator - can this be done? I mean - activate trailing stop-loss when indicator1 gives signal1? otherwise the trade should reach reach the dynamic stop-loss set at trade entry (multiple of Average True range) or exit with the breakeven after the price closes above entry (break-even activator signal - also activated after trade is placed - not at trade placement)?
    Can this be done?



  • @Impulse-Five said in Complex trading logic:

    which is activated on the future value of an indicator

    I don't understand this question. how can one predict the future value of a indicator ( if you mean Ichimoku otherwise )

    @Impulse-Five said in Complex trading logic:

    activate trailing stop-loss when indicator1 gives signal1?

    Yes its possible. I normally keep my stop loss in my code and send order when its triggered.

    @Impulse-Five said in Complex trading logic:

    otherwise the trade should reach reach the dynamic stop-loss set at trade entry (multiple of Average True range) or exit with the breakeven after the price closes above entry (break-even activator signal - also activated after trade is placed - not at trade placement)

    I trail my stop loss based on price movement , and I also have a threshold for activating it. but I keep my SL at system and not with broker.

    Essentially BT can fit your requirements.



  • @rajanprabu

    thank you for your reply,,,

    I don't understand this question. how can one predict the future value of a indicator ( if you mean Ichimoku otherwise )

    I mean for example start trailing the position ONLY AFTER certain indicator gives the signal (for example when rsi goes above 60,,,,can it also be a custom indicator?) - otherwise keep the stop-loss and break-evens active - breakevenm is also activated ONLY after the price has closed above entry - this is possible also?



  • I need to add that the trailing stop-loss is activated after a certain signal is given but the exit is sent to the broker AFTER the trailing stop-loss is triggered itself...can this be done? I was able to simulate this outside of python- not sure if backtrader can handle this?



  • please advice if this can be done or a zipline cane achieve this?


Log in to reply
 

});