Weekend evening - page 48

 
Aleksey Panfilov:

The value of the green line varies from 0 to 360 degrees. A signal to sell, for example, could be a value of 180. If the previous value is less than 180, and the current value is greater than or equal to it, the signal is there.

In such an example, the signal to close would be 180 for the value of the red line plus 360.

It is more convenient to select the signal values approximately in the middle of the green line, e.g. 150, 180, 210, 240.

Correspondingly, the position reversal signals if the values of the red line added to 360 will be 150, 180, 210, 240.

The lines themselves can easily be moved 360 degrees by selecting a leverage ("leverage") from 1 to 145, where 145 is the period of the sine wave.

"Blue", "green", "purple to speckled" ... These are just labels and nothing more. Especially since there is no green (clrGreen) at all:


 
Vladimir Karputov:

"Blue", "green", "mottled purple" ... These are just labels and nothing more. Especially since there is no green (clrGreen) at all:


I see what this is about. (

Now.

Green phase line, 5th line is read from array 4.

Red lower phase line, line 6 is read from array 5.

 

Forum on trading, automated trading systems and trading strategy testing

Looking for an Indicator for trading pairs

Vogul, 2020.04.09 15:45

i am looking for an indicator to trade on pairs and i dont know how to use it. I wanted to write an Expert Advisor in my time on 5 minute candlesticks. The idea is simple. We start an indicator for each pair, which locally on 5-minute candlesticks determines the direction of price movement. This may even be RSI. The advisor opens deals on these pairs according to the indicator.

The Expert Advisor starts separately on each pair, and exchanges them about the state of the trade through the global variables.

If both pairs have profit, they take it independently.

If only one of them has profit, at the moment when they have a breakeven in total, both of them close the positions.

If there are no profits, one stops just in case. This moment needs to be studied. Many interesting things can happen here. For example, a reversal. It can be only on one pair or on both of them. So it is like this.

But later I decided to abandon this idea. Recently, couples have begun to behave more independently of each other. Different times are coming. I think it's risky to trade on pair trades. Now it's "Tamara and I don't go in pairs".


 
Vladimir Karputov:

The plan is the following: the multicurrency Expert Advisor for two symbols is being developed. And then we'll see ...


Added: The codes will be in projects - look for the projectTwo_Symbols_iRSI_EA through the MetaEditor


Added: signals for RSI taken here (Relative Strength Index oscillator signals ) and taken one signal for BUY and one signal for SELL:

Signal type

Condition description

Over Bought

  • Reversal below oversold- the oscillator has reversed upwards and its value on the analyzed bar is below the oversold level (30 by default).

To sell

  • Reversebehind the overbought level- the oscillator has reverseddown and its value on the analysed bar is below the overbought level (by default 70).

 
Two_Symbols_iRSI_EA. 1.001. The Expert Advisor opens positions based on signals on two symbols (one symbol works independently of the other).
 
Two_Symbols_iRSI_EA. 1.002 Added parameter'Profit target, in deposit money' - total positions closed on two symbols if total profit on one and second symbol reaches'Profit target, in deposit money'.
 
Vladimir Karputov:
Two_Symbols_iRSI_EA. 1.002 Added parameter'Profit target, in deposit money' - total positions closing on two symbols, if total profit on one and second symbol reaches'Profit target, in deposit money'.
Thank you, we are testing! Vladimir,
Can we add an averaging rule ? Can we control the number of open orders?
2. Can we add correlation control, at least for two pairs for now? I think it's important when trades are opened on several pairs at once. https://www.ig.com/en/trading-strategies/a-trader_s-guide-to-currency-pair-correlations-in-the-forex-mark-191223
 
Valentin Petukhov:
Thank you, we are testing! Vladimir,
1. Shall we add averaging? Can we control the number of open orders?
2. Can we add correlation control, at least for two pairs for now? I think this is important when trades are opened on several pairs at once. https://www.ig.com/en/trading-strategies/a-trader_s-guide-to-currency-pair-correlations-in-the-forex-mark-191223

First, control the number of positions.

Then the averaging.

 
Vladimir Karputov:

First, controlling the number of positions.

Then the averaging.

Two_Symbols_iRSI_EA. 1.003 Added parameter'Maximum positions' for each symbol.

 
Vladimir Karputov:

Two_Symbols_iRSI_EA.

The averaging can be different:

  • For example now - parameter 'Only one positions' is set to'false' (and it is common, for symbol 0 and symbol 1) -> means that there can be several positions. So there can be a few variants (taking into account that there is a'Close opposite' parameter) - forced closing of opposite positions:
    • several positions of the same type, opened differently: one higher than the other and one lower than the other
    • several positions of different types may be opened one after another ('Close opposite' is set to'false')
  • Volume building can be controlled in the following way (these are new methods, so it's up for discussion) :
    • to build up in increments and with a strict rule: the next position may be opened'only above' or'only below'.
    • only go up if there isa 'loss for one direction' ora 'profit for one direction' (the direction is BUY or SELL on the symbol, NOT TWO symbols)
    • only increase if there is a'combined loss on two directions' or there is a'combined gain on two directions' (direction - BUY or SELL on the symbol, NOT TWO SIGNS)

... Your options