consulente esperto - domande varie
Grazie per il commento.
Ho provato come segue, ora il mercato è chiuso 'timeout.wav'. Ma non sono sicuro che 'ok.wav'suonerà per il nuovo ordine o no?
Puoi farmi sapere, per favore?
if ( expression )
{
...
} //---if Close
if ( _ticket > 0 )
{
PlaySound( "ok" );
} //---if Close
//---
if ( _ticket < 0 )
{
PlaySound( "timeout.wav" );
} //---if Close
Grazie.
Sostituire con la funzione di stampa ed eseguirla nel tester.
Da quello che posso vedere è corretto.
Si potrebbe usare -1 al posto di <0 ma il risultato sarebbe simile.
OK! Grazie. Lo proverò lunedì.
//--- seconda volta modificato
Funziona bene.
Puoi vedere i codici del mio 'test' EA. Ho bisogno di aiuto, per favore.
int_example = 1 ;
double _lotStep = 0.01 ,
_lot = 0.09 ;
string _prefix = "| TP -" ,
_edtLot = _prefix + " Lot" ,
_btnLotMinus = _prefix + " Button Minus" ;
//---init
_PanelDraw();
//---OnChartEvent
if ( sparam == _btnLotMinus )
{
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_STATE, false );
_lot = _lot - _lotStep;
if ( _lot <= 0 )
_lot = _lotStep;
Print( "| Just You Clicked Button Lot Minues" );
return;
} //---if Close
//---
void _PanelDraw()
{
//---Button
ObjectCreate ( 0, _btnLotMinus, OBJ_BUTTON , 0, 0, 0 );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_XDISTANCE , 16 );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_YDISTANCE , 16 );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_XSIZE , 80 );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_YSIZE , 32 );
ObjectSetString ( 0, _btnLotMinus, OBJPROP_TEXT , "-" );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_FONTSIZE , 20 );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_STATE , false );
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_SELECTABLE , false );
Print( "I am Minus" );
//---Lot
ObjectCreate ( 0, _edtLot, OBJ_EDIT , 0, 0, 0 );
ObjectSetInteger( 0, _edtLot, OBJPROP_COLOR , Red );
ObjectSetInteger( 0, _edtLot, OBJPROP_XDISTANCE , 16 );
ObjectSetInteger( 0, _edtLot, OBJPROP_YDISTANCE , 56 );
ObjectSetInteger( 0, _edtLot, OBJPROP_XSIZE , 80 );
ObjectSetInteger( 0, _edtLot, OBJPROP_YSIZE , 32 );
ObjectSetString ( 0, _edtLot, OBJPROP_TEXT , "Lot: " + DoubleToStr( _lot, 2 ) );
ObjectSetInteger( 0, _edtLot, OBJPROP_FONTSIZE , 12 );
ObjectSetInteger( 0, _edtLot, OBJPROP_STATE , true );
ObjectSetInteger( 0, _edtLot, OBJPROP_READONLY , true );
Print( "I am Minus" );
//---
return;
}
Grazie!
//---OnChartEvent
if ( sparam == _btnLotMinus )
{
ObjectSetInteger( 0, _btnLotMinus, OBJPROP_STATE, false );
_lot = _lot - _lotStep;
if ( _lot <= 0 )
_lot = _lotStep;
Print( "| Just You Clicked Button Lot Minues" );
return;
} //---if Close
Questa non è la funzione OnChartEvent
Questo è
const long& lparam, // Parameter of type long event
const double& dparam, // Parameter of type double event
const string& sparam // Parameter of type string events
);
if(id==CHARTEVENT_OBJECT_CLICK)
{
//
}
sembra essere ok, ma assicurati che lotstep stesso non vada sotto lo 0,01
Ma il lotto non diminuisce non l'ho visto.
Dove vi aspettate di vederlo?
Ciao,
Provo a usare il codice 'else {}' quando il mercato chiuso solo potrebbe suonare.
Ma due suoni mescolati, dove è un problema, per favore?
if( sparam == "SELL GROUP" )
{
ObjectSetInteger ( 0, "SELL GROUP", OBJPROP_STATE, false );
_ticket = Order ( "SELL GROUP" );
PlaySound ( "ok.wav" );
}
else
{
PlaySound( "timeout.wav" );
}
Meglio.
(L'inglese non è la mia lingua madre)