https://prnt.sc/s5rd7p
Like in this chart based on some Buy/sell logic i am getting just 1 sl/tsl thick blue line
Like in this chart based on some Buy/sell logic i am getting just 1 sl/tsl thick blue line
list0 = CategoryGetSymbols( categoryWatchlist, 0 ); // List contains cash scripts
list1 = CategoryGetSymbols( categoryWatchlist, 1 ); // List contains futures scripts
cash_bull=cash_bear=future_bull=future_bear=0;
for(i = 0; (sym1 = StrExtract(list0, i)) != ""; i++)
{
SetForeign(sym1) ;
cash_bull=O==L;
cash_bear=O==H;
for(j = 0; (sym2 = StrExtract(list1, j)) != ""; j++)
{
if(sym2 == sym1+"_F1")
{
SetForeign(sym2) ;
future_bull=O==L;
future_bear=O==H;
RestorePriceArrays( );
}
}
RestorePriceArrays( );
}
bullish=cash_bull AND future_bull ;
bearish=cash_bear AND future_bear;
Filter = ( InWatchList( 0 ) OR InWatchList( 1 ) ) AND ( bullish OR bearish ) AND StrFind(Name(),"_F1")==0 ;
AddColumn( IIf( bullish, C, Null ), "Bullish C (cash)", 1.2, 27 );
AddColumn( IIf( bullish, o, Null ), "O (cash)", 1.2, 27 );
AddColumn( IIf( bullish, l, Null ), "L (cash)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","C"), Null ), "Bullish C (future)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","O"), Null ), "O (future)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","L"), Null ), "L (future)", 1.2, 27 );
AddColumn( IIf( bearish, C, Null ), "Bearish C (cash)", 1.2, 4 );
AddColumn( IIf( bearish, o, Null ), "O (cash)", 1.2, 4 );
AddColumn( IIf( bearish, h, Null ), "H (cash)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","C"), Null ), "Bearish C (future)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","O"), Null ), "O (future)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","H"), Null ), "H (future)", 1.2, 4 );
list0 = CategoryGetSymbols( categoryWatchlist, 0 ); // List contains cash scripts
list1 = CategoryGetSymbols( categoryWatchlist, 1 ); // List contains futures scripts
cash_bull=cash_bear=future_bull=future_bear=0;
for(i = 0; (sym1 = StrExtract(list0, i)) != ""; i++)
{
SetForeign(sym1) ;
cash_bull=O==L;
cash_bear=O==H;
for(j = 0; (sym2 = StrExtract(list1, j)) != ""; j++)
{
if(sym2 == sym1+"_F1")
{
SetForeign(sym2) ;
future_bull=O==L;
future_bear=O==H;
RestorePriceArrays( );
}
}
RestorePriceArrays( );
}
bullish=cash_bull AND future_bull ;
bearish=cash_bear AND future_bear;
Filter = ( InWatchList( 0 ) OR InWatchList( 1 ) ) AND ( bullish OR bearish ) AND StrFind(Name(),"_F1")==0 ;
AddColumn( IIf( bullish, C, Null ), "Bullish C (cash)", 1.2, 27 );
AddColumn( IIf( bullish, o, Null ), "O (cash)", 1.2, 27 );
AddColumn( IIf( bullish, l, Null ), "L (cash)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","C"), Null ), "Bullish C (future)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","O"), Null ), "O (future)", 1.2, 27 );
AddColumn( IIf( bullish, Foreign(Name()+"_F1","L"), Null ), "L (future)", 1.2, 27 );
AddColumn( IIf( bearish, C, Null ), "Bearish C (cash)", 1.2, 4 );
AddColumn( IIf( bearish, o, Null ), "O (cash)", 1.2, 4 );
AddColumn( IIf( bearish, h, Null ), "H (cash)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","C"), Null ), "Bearish C (future)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","O"), Null ), "O (future)", 1.2, 4 );
AddColumn( IIf( bearish, Foreign(Name()+"_F1","H"), Null ), "H (future)", 1.2, 4 );