I see here that double can handle negative numbers:
http://book.mql4.com/basics/types. So... can I input a negative value as a MetaTrader Variable created in SB (when I attach the EA to a chart)?
This works fine when I assign the negative value directly in a TA block:if ( ( iCustom(Symbol(),0,"NzdUsdm_AudUsdm",0,0) <=
-0.01000 ) && (CalculateOpenPositions("AUDUSDm",OP_SELL,MagicNumberShort)<=4) )
{ SELL("AUDUSDm",S_AUDUSD_LS_4,S_AUDUSD_TP_4,S_AUDUSD_SL_4,S_AUDUSD_TS_4,"if ( ( iCustom(Symbol(),0,NzdUsdm_AudUsdm,0,0) <=
-0.01000 ) && (CalculateOpenPositions(AUDUSDm,OP_SELL,MagicNumberShort)<=4) )") ;}
But the condition is ignored (EA enters all shorts immediately upon attachment to a chart) when I use a MetaTrader Variable in a TA+ block (and then input the negative value later):if ( ( iCustom(Symbol(),0,"NzdUsdm_AudUsdm",0,0) <= iAC(Symbol(),0,
EntryLevel5) ) && (CalculateOpenPositions("AUDUSDm",OP_SELL,MagicNumberShort)<=4) )
{ SELL("AUDUSDm",S_AUDUSD_LS_0,S_AUDUSD_TP_0,S_AUDUSD_SL_0,S_AUDUSD_TS_0,"if ( ( iCustom(Symbol(),0,NzdUsdm_AudUsdm,0,0) <= iAC(Symbol(),0,
EntryLevel5) ) && (CalculateOpenPositions(AUDUSDm,OP_SELL,MagicNumberShort)<=4) )") ;}
[update: I rebuilt the imported indi in TIB to read positive and reversed my conditions in SB--same result]. Any ideas?