Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Indicatore Test Hours Buy Sell //
- // Compra e vende alla candela successiva ad ogni candela in base all'orario scelto //
- // Unger Miglior Ora Per Andare A Mercato Sull'Orario
- // Ottimizzazione da 0 a 23 o da 0 a ... usa il plot sotto per vedere le sessioni di mercato quando il mercato è aperto
- // Mettere input testphase a 1 per solo long long, input testphase a 2 per solo short
- // Timeframe Orarion
- // Se Ottimizzati Insieme I Risultati Cambiano Del Farlo Separatamente Per Poi Unirli Alla Fine
- // Attenzione l'acquisto è alla candela successiva quindi anche se ora 0 = mezzanotte, entrerà all'ora 1 etc... !!! //
- {Input: InitialCapital(100000);
- Input: percent_risk(100);
- input: input_stop_loss(11);}
- Input: testphase(1);
- Input: mycounter(0);
- Variable:
- risk(0), nr_share(0), stop_loss(0), mycount(0);
- //Money menagment
- {risk = percent_risk/100;
- nr_share = floor((InitialCapital + NetProfit) * risk) / close;
- stop_loss=((((InitialCapital + NetProfit) * risk)/100) * input_stop_loss);}
- ////////////// ////////////// //////////////
- If Time = 0 then mycount = 0 else mycount = mycount + 1;
- If testphase = 1 then begin // Solo Long
- if mycounter = mycount then buy next bar at market;
- if marketposition = 1 then sell next bar at market;
- end;
- If testphase = 2 then begin // Solo Short
- if mycounter = mycount then sellshort next bar at market;
- if marketposition = -1 then buytocover next bar at market;
- end;
- ////////////// ////////////// //////////////
- // Creare un indicatore per plottare le ore //
- {var:
- mycount(0);
- If Time = 0 then mycount = 0 else mycount = mycount + 1;
- plot1(Time);
- plot2(mycount)}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement