fikira

multiple orders - strategy - educational

Hi,

Here is a 'template', using array's, for multiple orders and different SL/TP levels per trade (This is an example with max 5 open trades)

The 'switch' makes sure that the first available position will be used,
for example, when 'L1' is closed in the past, and a buy condition is triggered, position 'L1' will be filled,
should it be that 'L1', 'L2', 'L3' are already filled, then position 'L4' will be filled, ...

An extra table is added with data of the trades
Be aware, the 'Buy and Hold' resembles the profit when 100% of the available equity has been bought at the time of the very first trade and sold now. On the other hand, the positions work with a % of equity, 20% per trade (5 x 20 = 100%)

You can see that every trade exits on its own terms, without interference of other trades

Important, this technique only works if in the strategy() function:
- close_entries_rule -> set at 'ANY'
- pyramiding is set at max amount of trades or higher (in this case 5 or higher)

Cheers!

LuxAlgo Dev: www.luxalgo.com
PineCoder: www.pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?