Buongiorno,
mi serve aiuto !! non riesco a modificare le quantità dei contratti nel codice allegato.
Grazie a tutti
Se posti il codice, usando il pulsante “Insert PRT code” è meglio, così si può vedere senza doverlo scaricare e installare.
Dai un titolo significativo al tuo argomento. Descrivi la tua domanda o l’oggetto nel titolo. Non utilizzare titoli privi di significato come “Aiuto per la codifica”.
//-------------------------------------------------------------------------
// Codice principale : nn si sa m.a. colorata bull
//-------------------------------------------------------------------------
//SPEAD = 2.5
//Capital = £500
//Trading hours from DAX open until NYSE close. No after hours trading.
//Time is UTC +2 (South Afica time)
DEFPARAM CumulateOrders = false // Cumulating positions deactivated
a=average[z] (close)
if a[1]<a then
alex=100
endif
if a[1] > a then
alex=50
endif
// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 090000
timeEnterBefore = time >= noEntryBeforeTime
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 173000
timeEnterAfter = time < noEntryAfterTime
// Conditions to enter long positions
indicator1 = WeightedAverage[x](totalPrice)
c1 = (High CROSSES OVER indicator1)
indicator2 = WeightedAverage[y](totalPrice)
c2 = (low CROSSES OVER indicator2)
IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter and COUNTOFPOSITION=0 and alex=100 THEN
Buy 1 CONTRACT AT MARKET
ENDIF
indicator3 = WeightedAverage[x](totalPrice)
c3 = (low CROSSES UNDER indicator3)
indicator4 = WeightedAverage[y](totalPrice)
c4 = (High CROSSES UNDER indicator4)
IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter and COUNTOFPOSITION=0 and alex=50 THEN
SellShort 1 CONTRACT AT MARKET
ENDIF
// Stops and targets
SET TARGET $PROFIT 10
SET STOP $LOSS 200
Perfetto, provo !! (è la prima volta)
Grazie.
Basta che tu sostituisca 1 con un altro numero alle righe 35 e 44.
Dovrai adeguare anche i valori delle righe 48 e 49. Se passi da 1 a 2 contratti anche quei valori andranno moltiplicati per due, altrimenti in realtà si dimezzerebbero perché rischieresti e guadagneresti la stessa somma ma con 2 contratti anziché 1.
Perfetto Roberto, ora funziona come un orologio Svizzero !!
Ti ringrazio e a presto.
Ciao.