OK so first of all there is a problem where this does not act symmetrically and I have identified the two bugs below and explained how to fix them!
//--------------------------------------------------------------------
// Trading rule: Long entry (On Bar Open)
//--------------------------------------------------------------------
if ((LongEntrySignal
and Not LongExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Long))
{
// Action #1
Open Long order at (Fibo(Main chart, High-low previous week, Fibo Level = -23.6)[] + (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}
//--------------------------------------------------------------------
// Trading rule: Short entry (On Bar Open)
//--------------------------------------------------------------------
if ((ShortEntrySignal
and Not ShortExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Short))
{
// Action #1
Open Short order at (Fibo(Main chart, High-low previous week, Fibo Level = 123.6)[] - (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}
Bug#1 there is no 123.6 is available in the dropdown of algowizard for fibo levels.
Bug#2
Java is already reversing the calculation Low-High instead of High-Low depending on if it's a bullish or bearish reading so there is no need to also reverse the fibo level number! Just leave the level the same and all will be symmetrical! For cosmetics you could show Low-High in the pseudocode and to fix the symmetry issue, you would keep the levels the same so the above becomes:
//--------------------------------------------------------------------
// Trading rule: Long entry (On Bar Open)
//--------------------------------------------------------------------
if ((LongEntrySignal
and Not LongExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Long))
{
// Action #1
Open Long order at (Fibo(Main chart, High-low previous week, Fibo Level = -23.6)[] + (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}
//--------------------------------------------------------------------
// Trading rule: Short entry (On Bar Open)
//--------------------------------------------------------------------
if ((ShortEntrySignal
and Not ShortExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Short))
{
// Action #1
Open Short order at (Fibo(Main chart, low-High previous week, Fibo Level = -23.6)[] - (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}
The orange is cosmetic only for pseudocode, the java is already acting that way. This will fix the symmetry issue 100%.
As for the signal, since long signal and short signal are not necessarily mutually exclusive to the bullish and bearish reading of the fibo, I strongly recommend making them so because a bearish fibo reading makes no sense for a bullish signal.
//--------------------------------------------------------------------
// Trading rule: Long entry (On Bar Open)
//--------------------------------------------------------------------
if ((LongEntrySignal
and Not LongExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Long))
{
// Action #1
*****if (previous week is bullish)***** Open Long order at (Fibo(Main chart, High-low previous week, Fibo Level = -23.6)[] + (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}
//--------------------------------------------------------------------
// Trading rule: Short entry (On Bar Open)
//--------------------------------------------------------------------
if ((ShortEntrySignal
and Not ShortExitSignal)
and (MarketPosition("Current", MagicNumber, "") is Not Short))
{
// Action #1
*****if (previous week is bearish)***** Open Short order at (Fibo(Main chart, low-High previous week, Fibo Level = -23.6)[] - (ATR(Main chart,ATRPeriod1)[2] * PriceEntryMult1)) Limit;
Order valid for BarsValid bars;
Duplicate trades: allowed;
Replacing pending orders: allowed;
Stop Loss = SLm * ATR(SLp);
}