Fibo Symmetry

LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2)) is not symmetrical. Fibo should either be drawn Close-Open for one of them like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Close-Open previous day, Fibo Level = 38.2)) OR should have the levels reversed by the formula "Reverse_Fibo_Level = 100 - Original_Fibo_Level" like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 61.8))



Attachments
Strategy 044594_fibo.sqx
(48.57 KiB)
  • Votes +5
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

bentra

01.08.2019 09:32

Task created

b
#2

bentra

01.08.2019 19:56

Attachment Strategy 030191_fib2.sqx added

Please note that re-installing cleanly did not fix the Fibo Symetry, both long and short signals are drawing the fibo in the same direction...
Yes, most definitely the reverse of the Fibo indicator should be either drawn in reverse (drawn from Low-High / High-Low) or the levels need to be reversed (+261.8 / -261.8) in this way we can have symmetry for SL, traling SL, TP and Entries.

Here is another example:

//--------------------------------------------------------------------
// Trading rule: Long entry (On Bar Open)
//--------------------------------------------------------------------
if LongEntrySignal
{
// Action #1
Open Long order at Market;
Duplicate trades: disabled;
Stop Loss = 4.7* ATR(64);

Trailing Stop = Fibo(Main chart, High-Low previous day, Fibo Level = 261.8);

}


//--------------------------------------------------------------------
// Trading rule: Short entry (On Bar Open)
//--------------------------------------------------------------------
if (ShortEntrySignal
and Not LongEntrySignal)
{
// Action #1
Open Short order at Market;
Duplicate trades: disabled;
Stop Loss = 4.7* ATR(64);

Trailing Stop = Fibo(Main chart, High-Low previous day, Fibo Level = 261.8);

}
b
#3

bentra

01.08.2019 19:58
Voted for this task.
b
#4

bentra

01.08.2019 20:08
"or the levels need to be reversed (+261.8 / -261.8)"

Is incorrect! It should read

"or the levels need to be reversed (+61.8 / +38.2...... 0 / +100 .... +161.8 / -61.8......+261.8 / -161.8 etc.)"

if both fibo for long and short are drawn the same way such as High-Low then Reverse_Fibo_Level = 100 - Original_Fibo_Level
o
#5

Enric

06.08.2019 17:31
Voted for this task.
b
#6

bentra

07.08.2019 02:38

Description changed:

LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2)) is not symmetrical. Fibo should either be drawn Close-Open for one of them like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Close-Open previous day, Fibo Level = 38.2)) OR should have the levels reversed by the math "Reverse_Fibo_Level = 100 - Original_Fibo_Level" like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 61.8))



b
#7

bentra

07.08.2019 02:39

Description changed:

LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2)) is not symmetrical. Fibo should either be drawn Close-Open for one of them like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Close-Open previous day, Fibo Level = 38.2)) OR should have the levels reversed by the formula "Reverse_Fibo_Level = 100 - Original_Fibo_Level" like this:
LongEntrySignal = (LinReg(Main chart,53)[1] > Fibo(Main chart, Open-Close previous day, Fibo Level = 38.2));

ShortEntrySignal = (LinReg(Main chart,53)[1] < Fibo(Main chart, Open-Close previous day, Fibo Level = 61.8))



m
#8

mabi

22.08.2019 13:20
Voted for this task.
da
#9

Artur

23.08.2019 23:10
Voted for this task.
DR
#10

mentaledge

26.08.2019 14:41
Voted for this task.
b
#11

bentra

23.01.2020 19:03
Bump
6 months have nearly passed. Symmetry is important to some of us.
MF
#12

Mark Fric

23.04.2020 14:16

Status changed from New to Fixed

sorry for taking too long, it is fixed in B127. It is done in custom FiboNegater snippet, the code (just for the information) is as follows:


@SortOrder(900000)

public class FiboNegater extends Negater {

public static final Logger Log = LoggerFactory.getLogger("FiboNegater");

//------------------------------------------------------------------------

//------------------------------------------------------------------------

//------------------------------------------------------------------------


@Override

public IBlock negate(NegatersList negatersList, IBlock block, int blockType, int returnType, StrategyBase strategy) throws BlockDefinitionException {

IBlock oppositeBlock = Blocks.getOppositeBlock(block);

if(!block.getClass().getSimpleName().equals("Fibo")) {

// it is not Fibo block, skip

return null;

}


// standard negation first

ParametersHelper.negateParametersInClonedBlock(block, oppositeBlock, negatersList, strategy);

ParametersHelper.negateDataSeries(block, oppositeBlock);


// now special Fibo negation

Fibo source = (Fibo) block;

Fibo opposite = (Fibo) oppositeBlock;

opposite.FiboLevel = 100 - source.FiboLevel;

return opposite;

}

}


Votes: +5

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please