Error

 Previous Topic Next Topic
 MS Support #1 Posted : Friday, July 28, 2017 10:54:56 PM(UTC) Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,949Thanks: 89 timesWas thanked: 155 time(s) in 150 post(s) Domenico D’Errico & Giovanni Trombetta's article, “Artificial Intelligence for System Development” presents a trading system created through genetic algorithms. The system is fully explained in their article and only the code is provided here. As designed, the system gives entry and exit signals to be acted upon on the following bar. The formulas below were written to look for the signal on the previous bar and then enact them on the current bar.  The effect is the same but the logic is easier to implement.General tab:Name: Gandalf AI SystemNotes: Created by Roberto Giaccio. Based on previous version by Giovanni Trombetta.Buy Order tab:Formula:Code:``````avgp:= (open + high + low + close)/4; medp:= (high + low)/2; medbp:= (open + close)/2; entrySignal:= (Ref(avgp < medp, -1) AND ref(medp,-2) <= ref(avgp,-1) AND ref(medbp,-2) <= ref(avgp, -3)) OR (ref(avgp,-1) < ref(medp, -3) AND ref(medbp,-1) < ref(medp, -2) AND ref(medbp,-1) < ref(medbp, -2)); ref(entrySignal, -1)`````` Order Type: LimitLimit or Stop Price: Ref(low, -1) + 0.08Entry Size: 10000Expiration: Good for DaySell Order tab:Formula:Code:``````avgp:= (open + high + low + close)/4; medp:= (high + low)/2; medbp:= (open + close)/2; profit:= Simulation.CurrentPositionProfit; time:= Simulation.CurrentPositionAge; exitSignal:= (profit >0 AND time >= 6) OR (profit <=0 AND (time >= 8) OR (Ref(avgp < medbp, -1) AND ref(medp, -2) = ref(medbp, -3) AND ref(medbp, -1) <= ref(medbp, -4)) OR (ref(avgp,-2) < medbp AND ref(medp,-4) <= ref(avgp,-3) AND ref(medbp <= avgp, -1) ) OR (ref(avgp,-2) < medbp AND ref(medp,-4) <= ref(avgp,-3) AND ref(medbp <= avgp, -1))); Ref(exitSignal, -1)`````` Order Type: Stop LimitLimit or Stop Price: OpenEdited by user Monday, July 31, 2017 5:19:48 PM(UTC)  | Reason: Not specified
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 Users browsing this topic
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.