This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Function to detect pivot pattern with variable left and right bars | |
| // We're assuming that if we're using onTick, the signal may end up being false | |
| // Therefore the point will need to be deleted if the signal switches from true to false | |
| public bool IsPivotHigh(int leftBars, int rightBars) | |
| { | |
| //if you want to ensure that when using ontick the signal doesn't flare up and down | |
| //so that there will be no need to be deleted, shift the signal one bar | |
| //(skip the one that is being developed) and use this offset | |
| //int offset = Calculate == Calculate.OnBarClose ? 0 : 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //#region TimeFilter | |
| //[Parameter("Use Time Filter", DefaultValue = false, Group = "Filters - Time")] | |
| //public bool InputUseTimeFilter { get; set; } | |
| //[Parameter("Time Start", DefaultValue = "00:00", Group = "Filters - Time")] | |
| //public string InputTimeFilterStart { get; set; } | |
| //[Parameter("Time End", DefaultValue = "08:00", Group = "Filters - Time")] | |
| //public string InputTimeFilterEnd { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // [Parameter("Use Trailing Stop", DefaultValue = false)] | |
| // public bool InputUseTrailingStop { get; set; } | |
| // | |
| // [Parameter("Trailing Stop Trigger", DefaultValue = 10)] | |
| // public double InputTrigger { get; set; } | |
| // | |
| // [Parameter("Trailing Stop", DefaultValue = 5)] | |
| // public double InputTrailingStop { get; set; } | |
| //_label is the label used for the positions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using cAlgo.API.Internals; | |
| namespace MyUtilities | |
| { | |
| public static class VolumeTools | |
| { | |
| public static double VolumeAtRisk(Symbol symbol, double balance, double riskPct, double sl) | |
| { | |
| //Print($"Amount to Risk {Account.Balance * (riskPct / 100.0)} with a SL {sl} * PipValue of {sl * symbol.PipValue}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //+------------------------------------------------------------------+ | |
| //| UsefulFunctions.mq4 | | |
| //| Copyright 2018, MetaQuotes Software Corp. | | |
| //| https://www.mql5.com | | |
| //+------------------------------------------------------------------+ | |
| #property copyright "Copyright 2018, MetaQuotes Software Corp." | |
| #property link "https://www.mql5.com" | |
| #property version "1.00" | |
| #property strict | |
| //+------------------------------------------------------------------+ |